diff options
Diffstat (limited to 'spec/frontend/flash_spec.js')
-rw-r--r-- | spec/frontend/flash_spec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/frontend/flash_spec.js b/spec/frontend/flash_spec.js index 96e5202780b..f7bde8d2f16 100644 --- a/spec/frontend/flash_spec.js +++ b/spec/frontend/flash_spec.js @@ -3,6 +3,7 @@ import createFlash, { createAction, hideFlash, removeFlashClickListener, + FLASH_CLOSED_EVENT, } from '~/flash'; describe('Flash', () => { @@ -79,6 +80,16 @@ describe('Flash', () => { expect(el.remove.mock.calls.length).toBe(1); }); + + it(`dispatches ${FLASH_CLOSED_EVENT} event after transitionend event`, () => { + jest.spyOn(el, 'dispatchEvent'); + + hideFlash(el); + + el.dispatchEvent(new Event('transitionend')); + + expect(el.dispatchEvent).toHaveBeenCalledWith(new Event(FLASH_CLOSED_EVENT)); + }); }); describe('createAction', () => { |