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

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/modal.spec.js')
-rw-r--r--js/tests/unit/modal.spec.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js
index bf26377fe8..a127792344 100644
--- a/js/tests/unit/modal.spec.js
+++ b/js/tests/unit/modal.spec.js
@@ -642,11 +642,8 @@ describe('Modal', () => {
modalEl.addEventListener('shown.bs.modal', () => {
const spy = spyOn(modal, '_queueCallback').and.callThrough()
- const mouseOverEvent = createEvent('mousedown')
- const backdrop = document.querySelector('.modal-backdrop')
-
- backdrop.dispatchEvent(mouseOverEvent)
- backdrop.dispatchEvent(mouseOverEvent)
+ modalEl.click()
+ modalEl.click()
setTimeout(() => {
expect(spy).toHaveBeenCalledTimes(1)
@@ -714,8 +711,7 @@ describe('Modal', () => {
const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl)
modalEl.addEventListener('shown.bs.modal', () => {
- const mouseOverEvent = createEvent('mousedown')
- document.querySelector('.modal-backdrop').dispatchEvent(mouseOverEvent)
+ modalEl.click()
})
modalEl.addEventListener('hidden.bs.modal', () => {