mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-17 19:06:40 +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:
@@ -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()
|
||||
})
|
||||
|
||||
|
Reference in New Issue
Block a user