diff options
author | GeoSot <geo.sotis@gmail.com> | 2021-10-13 17:45:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-13 17:45:39 +0300 |
commit | b991a6b8510216ba25cff02e0cc6c338f9f76113 (patch) | |
tree | 79df6167c374fd1f20c1f37c2e69d415e50becd6 /js/tests/unit/util | |
parent | 9640e2d5dd4ace95d4fd9f03af160b4329e97282 (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.js | 7 |
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() }) }) |