Commit e5adec78 authored by Denys Mishunov's avatar Denys Mishunov

Fixed flaky IDE spec

parent 70084dd3
...@@ -44,11 +44,11 @@ describe('ide component, empty repo', () => { ...@@ -44,11 +44,11 @@ describe('ide component, empty repo', () => {
vm.$destroy(); vm.$destroy();
}); });
it('renders "New file" button in empty repo', done => { it('renders "New file" button in empty repo', async () => {
vm.$nextTick(() => { await waitForPromises();
expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).not.toBeNull(); await vm.$nextTick();
done();
}); expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).not.toBeNull();
}); });
}); });
...@@ -105,11 +105,11 @@ describe('ide component, non-empty repo', () => { ...@@ -105,11 +105,11 @@ describe('ide component, non-empty repo', () => {
}); });
describe('non-existent branch', () => { describe('non-existent branch', () => {
it('does not render "New file" button for non-existent branch when repo is not empty', done => { it('does not render "New file" button for non-existent branch when repo is not empty', async () => {
vm.$nextTick(() => { await waitForPromises();
expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).toBeNull(); await vm.$nextTick();
done();
}); expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).toBeNull();
}); });
}); });
...@@ -118,11 +118,11 @@ describe('ide component, non-empty repo', () => { ...@@ -118,11 +118,11 @@ describe('ide component, non-empty repo', () => {
store.state.trees['abcproject/master'].tree = [file()]; store.state.trees['abcproject/master'].tree = [file()];
}); });
it('does not render "New file" button', done => { it('does not render "New file" button', async () => {
vm.$nextTick(() => { await waitForPromises();
expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).toBeNull(); await vm.$nextTick();
done();
}); expect(vm.$el.querySelector('.ide-empty-state button[title="New file"]')).toBeNull();
}); });
}); });
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment