Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/frontend/flash_spec.js')
-rw-r--r--spec/frontend/flash_spec.js14
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);
+ });
+ });
+ });
});
});