Commit 010dd247 authored by Mark Fletcher's avatar Mark Fletcher

Merge branch 'dmishunov/fixing-ide_spec-timeout' into 'master'

Fixed the flaky IDE spec

See merge request gitlab-org/gitlab!47394
parents 98690d4b e5adec78
...@@ -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