diff options
Diffstat (limited to 'spec/frontend/filtered_search/visual_token_value_spec.js')
-rw-r--r-- | spec/frontend/filtered_search/visual_token_value_spec.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/frontend/filtered_search/visual_token_value_spec.js b/spec/frontend/filtered_search/visual_token_value_spec.js index 772fa7d07ed..7185f382fc1 100644 --- a/spec/frontend/filtered_search/visual_token_value_spec.js +++ b/spec/frontend/filtered_search/visual_token_value_spec.js @@ -1,11 +1,14 @@ import { escape } from 'lodash'; import FilteredSearchSpecHelper from 'helpers/filtered_search_spec_helper'; import { TEST_HOST } from 'helpers/test_constants'; -import DropdownUtils from '~/filtered_search//dropdown_utils'; +import DropdownUtils from '~/filtered_search/dropdown_utils'; import VisualTokenValue from '~/filtered_search/visual_token_value'; +import createFlash from '~/flash'; import AjaxCache from '~/lib/utils/ajax_cache'; import UsersCache from '~/lib/utils/users_cache'; +jest.mock('~/flash'); + describe('Filtered Search Visual Tokens', () => { const findElements = (tokenElement) => { const tokenNameElement = tokenElement.querySelector('.name'); @@ -43,7 +46,6 @@ describe('Filtered Search Visual Tokens', () => { }); it('ignores error if UsersCache throws', (done) => { - jest.spyOn(window, 'Flash').mockImplementation(() => {}); const dummyError = new Error('Earth rotated backwards'); const { subject, tokenValueContainer, tokenValueElement } = findElements(authorToken); const tokenValue = tokenValueElement.innerText; @@ -55,7 +57,7 @@ describe('Filtered Search Visual Tokens', () => { subject .updateUserTokenAppearance(tokenValueContainer, tokenValueElement, tokenValue) .then(() => { - expect(window.Flash.mock.calls.length).toBe(0); + expect(createFlash.mock.calls.length).toBe(0); }) .then(done) .catch(done.fail); |