diff options
Diffstat (limited to 'spec/frontend/search_autocomplete_spec.js')
-rw-r--r-- | spec/frontend/search_autocomplete_spec.js | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/spec/frontend/search_autocomplete_spec.js b/spec/frontend/search_autocomplete_spec.js index c643cf6557d..190f2803324 100644 --- a/spec/frontend/search_autocomplete_spec.js +++ b/spec/frontend/search_autocomplete_spec.js @@ -223,34 +223,22 @@ describe('Search autocomplete dropdown', () => { }); } - it('suggest Projects', (done) => { - // eslint-disable-next-line promise/catch-or-return - triggerAutocomplete().finally(() => { - const list = widget.wrap.find('.dropdown-menu').find('ul'); - const link = "a[href$='/gitlab-org/gitlab-test']"; + it('suggest Projects', async () => { + await triggerAutocomplete(); - expect(list.find(link).length).toBe(1); + const list = widget.wrap.find('.dropdown-menu').find('ul'); + const link = "a[href$='/gitlab-org/gitlab-test']"; - done(); - }); - - // Make sure jest properly acknowledge the `done` invocation - jest.runOnlyPendingTimers(); + expect(list.find(link).length).toBe(1); }); - it('suggest Groups', (done) => { - // eslint-disable-next-line promise/catch-or-return - triggerAutocomplete().finally(() => { - const list = widget.wrap.find('.dropdown-menu').find('ul'); - const link = "a[href$='/gitlab-org']"; + it('suggest Groups', async () => { + await triggerAutocomplete(); - expect(list.find(link).length).toBe(1); - - done(); - }); + const list = widget.wrap.find('.dropdown-menu').find('ul'); + const link = "a[href$='/gitlab-org']"; - // Make sure jest properly acknowledge the `done` invocation - jest.runOnlyPendingTimers(); + expect(list.find(link).length).toBe(1); }); }); |