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:
authorGeoSot <geo.sotis@gmail.com>2021-10-13 17:45:39 +0300
committerGitHub <noreply@github.com>2021-10-13 17:45:39 +0300
commitb991a6b8510216ba25cff02e0cc6c338f9f76113 (patch)
tree79df6167c374fd1f20c1f37c2e69d415e50becd6 /js/tests/unit/modal.spec.js
parent9640e2d5dd4ace95d4fd9f03af160b4329e97282 (diff)
tests: try to fix a few random failures (#35184)
* Change `Swipe` dispose spy on EventHandler * Modal hide spy on backdrop hide
Diffstat (limited to 'js/tests/unit/modal.spec.js')
-rw-r--r--js/tests/unit/modal.spec.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/js/tests/unit/modal.spec.js b/js/tests/unit/modal.spec.js
index a5308eb2b2..6e7b8fc88f 100644
--- a/js/tests/unit/modal.spec.js
+++ b/js/tests/unit/modal.spec.js
@@ -608,6 +608,7 @@ describe('Modal', () => {
const modalEl = fixtureEl.querySelector('.modal')
const modal = new Modal(modalEl)
+ const backdropSpy = spyOn(modal._backdrop, 'hide').and.callThrough()
modalEl.addEventListener('shown.bs.modal', () => {
modal.hide()
@@ -622,7 +623,7 @@ describe('Modal', () => {
expect(modalEl.getAttribute('role')).toBeNull()
expect(modalEl.getAttribute('aria-hidden')).toEqual('true')
expect(modalEl.style.display).toEqual('none')
- expect(document.querySelector('.modal-backdrop')).toBeNull()
+ expect(backdropSpy).toHaveBeenCalled()
done()
})