Use the promise from refreshStatus to know when we're done.

This commit is contained in:
joshaber
2016-01-11 15:16:54 -05:00
parent bf4cb2bc73
commit b661d41b2d

View File

@@ -404,7 +404,7 @@ describe('GitRepositoryAsync', () => {
// need to wait for that to complete before the tests continue so that
// we're in a known state.
repo = atom.project.getRepositories()[0].async
waitsFor(() => !repo._isRefreshing())
waitsForPromise(() => repo.refreshStatus())
})
it('emits a status-changed event when a buffer is saved', async () => {
@@ -480,7 +480,7 @@ describe('GitRepositoryAsync', () => {
// See the comment in the 'buffer events' beforeEach for why we need to do
// this.
const repository = atom.project.getRepositories()[0].async
waitsFor(() => !repository._isRefreshing())
waitsForPromise(() => repository.refreshStatus())
})
afterEach(() => {
@@ -494,7 +494,7 @@ describe('GitRepositoryAsync', () => {
project2.deserialize(atom.project.serialize(), atom.deserializers)
const repo = project2.getRepositories()[0].async
waitsFor(() => !repo._isRefreshing())
waitsForPromise(() => repo.refreshStatus())
runs(() => {
const buffer = project2.getBuffers()[0]