mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-11 18:02:28 +03:00
Event handler: replace deprecated initEvent
This commit is contained in:
@@ -191,8 +191,7 @@ describe('Offcanvas', () => {
|
||||
const offCanvasEl = fixtureEl.querySelector('div')
|
||||
const offCanvas = new Offcanvas(offCanvasEl, { backdrop: true })
|
||||
|
||||
const clickEvent = document.createEvent('MouseEvents')
|
||||
clickEvent.initEvent('mousedown', true, true)
|
||||
const clickEvent = new Event('mousedown', { bubbles: true, cancelable: true })
|
||||
spyOn(offCanvas._backdrop._config, 'clickCallback').and.callThrough()
|
||||
|
||||
offCanvasEl.addEventListener('shown.bs.offcanvas', () => {
|
||||
|
||||
@@ -169,8 +169,7 @@ describe('Backdrop', () => {
|
||||
}
|
||||
|
||||
instance.show(() => {
|
||||
const clickEvent = document.createEvent('MouseEvents')
|
||||
clickEvent.initEvent('mousedown', true, true)
|
||||
const clickEvent = new Event('mousedown', { bubbles: true, cancelable: true })
|
||||
document.querySelector(CLASS_BACKDROP).dispatchEvent(clickEvent)
|
||||
endTest()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user