aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/modal.spec.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js
index bf796411b..5d3f5cd9d 100644
--- a/js/tests/unit/modal.spec.js
+++ b/js/tests/unit/modal.spec.js
@@ -642,8 +642,11 @@ describe('Modal', () => {
modalEl.addEventListener('shown.bs.modal', () => {
const spy = spyOn(modal, '_queueCallback').and.callThrough()
- modalEl.click()
- modalEl.click()
+ const mouseOverEvent = createEvent('mousedown')
+ const backdrop = document.querySelector('.modal-backdrop')
+
+ backdrop.dispatchEvent(mouseOverEvent)
+ backdrop.dispatchEvent(mouseOverEvent)
setTimeout(() => {
expect(spy).toHaveBeenCalledTimes(1)
@@ -710,9 +713,9 @@ describe('Modal', () => {
const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl)
-
modalEl.addEventListener('shown.bs.modal', () => {
- modalEl.click()
+ const mouseOverEvent = createEvent('mousedown')
+ document.querySelector('.modal-backdrop').dispatchEvent(mouseOverEvent)
})
modalEl.addEventListener('hidden.bs.modal', () => {