diff options
Diffstat (limited to 'spec/frontend/flash_spec.js')
-rw-r--r-- | spec/frontend/flash_spec.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/frontend/flash_spec.js b/spec/frontend/flash_spec.js index 6d482e5814d..6a5ac76a4d0 100644 --- a/spec/frontend/flash_spec.js +++ b/spec/frontend/flash_spec.js @@ -339,6 +339,20 @@ describe('Flash', () => { expect(actionConfig.clickHandler).toHaveBeenCalled(); }); }); + + describe('additional behavior', () => { + describe('close', () => { + it('clicks the close icon', () => { + const flash = createFlash({ ...defaultParams }); + const close = document.querySelector('.flash-alert .js-close-icon'); + + jest.spyOn(close, 'click'); + flash.close(); + + expect(close.click.mock.calls.length).toBe(1); + }); + }); + }); }); }); |