1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-14 01:24:19 +02:00

Fix modal event-listeners during dismiss click (#36863)

ref: #36855
This commit is contained in:
GeoSot
2022-09-07 11:56:33 +03:00
committed by GitHub
parent 949456984a
commit 23fb7a7915
3 changed files with 20 additions and 12 deletions

View File

@@ -644,7 +644,9 @@ describe('Modal', () => {
const mouseDown = createEvent('mousedown')
modalEl.dispatchEvent(mouseDown)
modalEl.click()
modalEl.dispatchEvent(mouseDown)
modalEl.click()
setTimeout(() => {
expect(spy).toHaveBeenCalledTimes(1)
@@ -719,9 +721,11 @@ describe('Modal', () => {
const mouseDown = createEvent('mousedown')
dialogEl.dispatchEvent(mouseDown)
modalEl.click()
expect(spy).not.toHaveBeenCalled()
modalEl.dispatchEvent(mouseDown)
modalEl.click()
expect(spy).toHaveBeenCalled()
resolve()
})