mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-25 14:30:46 +02:00
tests: try to fix a few random failures (#35184)
* Change `Swipe` dispose spy on EventHandler * Modal hide spy on backdrop hide
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user