diff options
Diffstat (limited to 'spec/frontend/flash_spec.js')
-rw-r--r-- | spec/frontend/flash_spec.js | 49 |
1 files changed, 1 insertions, 48 deletions
diff --git a/spec/frontend/flash_spec.js b/spec/frontend/flash_spec.js index 2f0a52a9884..334117e0e3c 100644 --- a/spec/frontend/flash_spec.js +++ b/spec/frontend/flash_spec.js @@ -1,12 +1,6 @@ import * as Sentry from '@sentry/browser'; import { setHTMLFixture, resetHTMLFixture } from 'helpers/fixtures'; -import { - hideFlash, - addDismissFlashClickListener, - FLASH_CLOSED_EVENT, - createAlert, - VARIANT_WARNING, -} from '~/flash'; +import { hideFlash, FLASH_CLOSED_EVENT, createAlert, VARIANT_WARNING } from '~/flash'; jest.mock('@sentry/browser'); @@ -338,45 +332,4 @@ describe('Flash', () => { }); }); }); - - describe('addDismissFlashClickListener', () => { - let el; - - describe('with close icon', () => { - beforeEach(() => { - el = document.createElement('div'); - el.innerHTML = ` - <div class="flash-container"> - <div class="flash"> - <div class="close-icon js-close-icon"></div> - </div> - </div> - `; - }); - - it('removes global flash on click', () => { - addDismissFlashClickListener(el, false); - - el.querySelector('.js-close-icon').click(); - - expect(document.querySelector('.flash')).toBeNull(); - }); - }); - - describe('without close icon', () => { - beforeEach(() => { - el = document.createElement('div'); - el.innerHTML = ` - <div class="flash-container"> - <div class="flash"> - </div> - </div> - `; - }); - - it('does not throw', () => { - expect(() => addDismissFlashClickListener(el, false)).not.toThrow(); - }); - }); - }); }); |