aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2022-05-13 07:20:04 +0300
committerGitHub <[email protected]>2022-05-12 21:20:04 -0700
commitb167420bdf3c23ad9fb6c57818048c3c0e8da702 (patch)
tree2faa511ac7449cb81c1aaacde219c013a553c7f6 /js/tests/unit
parent88a6610895c05d05f4710d0783eb5ea2f30294fe (diff)
downloadbootstrap-b167420bdf3c23ad9fb6c57818048c3c0e8da702.tar.xz
bootstrap-b167420bdf3c23ad9fb6c57818048c3c0e8da702.zip
Revert backdrop utilization, handling clicks over modal (#36324)
* refactor(Modal.js): stop using backdrop class to handle clicks over modal * Revert #35554 and backdrop callback usage Explanation: In order to bypass `.modal`, was applied a css rule `pointer-events:none` which caused the side effect, and user couldn't scroll "long content modals" * Update .bundlewatch.config.json Co-authored-by: Mark Otto <[email protected]>
Diffstat (limited to 'js/tests/unit')
-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 bf26377fe..a12779234 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', () => {