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/util
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/util')
-rw-r--r--js/tests/unit/util/swipe.spec.js7
1 files changed, 3 insertions, 4 deletions
diff --git a/js/tests/unit/util/swipe.spec.js b/js/tests/unit/util/swipe.spec.js
index d6aeb17f6a..474e34f653 100644
--- a/js/tests/unit/util/swipe.spec.js
+++ b/js/tests/unit/util/swipe.spec.js
@@ -232,7 +232,7 @@ describe('Swipe', () => {
it('should destroy', () => {
const addEventSpy = spyOn(fixtureEl, 'addEventListener').and.callThrough()
- const removeEventSpy = spyOn(fixtureEl, 'removeEventListener').and.callThrough()
+ const removeEventSpy = spyOn(EventHandler, 'off').and.callThrough()
defineDocumentElementOntouchstart()
const swipe = new Swipe(fixtureEl)
@@ -253,9 +253,8 @@ describe('Swipe', () => {
swipe.dispose()
- expect(removeEventSpy.calls.allArgs()).toEqual(expectedArgs)
-
- delete document.documentElement.ontouchstart
+ expect(removeEventSpy).toHaveBeenCalledWith(fixtureEl, '.bs.swipe')
+ deleteDocumentElementOntouchstart()
})
})