mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 18:44:01 +02:00
Fix offcanvas test to expect the initial body overflow
value (#33927)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -180,6 +180,7 @@ describe('Offcanvas', () => {
|
|||||||
|
|
||||||
const offCanvasEl = fixtureEl.querySelector('.offcanvas')
|
const offCanvasEl = fixtureEl.querySelector('.offcanvas')
|
||||||
const offCanvas = new Offcanvas(offCanvasEl, { scroll: false })
|
const offCanvas = new Offcanvas(offCanvasEl, { scroll: false })
|
||||||
|
const initialOverFlow = document.body.style.overflow
|
||||||
|
|
||||||
offCanvasEl.addEventListener('shown.bs.offcanvas', () => {
|
offCanvasEl.addEventListener('shown.bs.offcanvas', () => {
|
||||||
expect(document.body.style.overflow).toEqual('hidden')
|
expect(document.body.style.overflow).toEqual('hidden')
|
||||||
@@ -187,7 +188,7 @@ describe('Offcanvas', () => {
|
|||||||
offCanvas.hide()
|
offCanvas.hide()
|
||||||
})
|
})
|
||||||
offCanvasEl.addEventListener('hidden.bs.offcanvas', () => {
|
offCanvasEl.addEventListener('hidden.bs.offcanvas', () => {
|
||||||
expect(document.body.style.overflow).not.toEqual('hidden')
|
expect(document.body.style.overflow).toEqual(initialOverFlow)
|
||||||
done()
|
done()
|
||||||
})
|
})
|
||||||
offCanvas.show()
|
offCanvas.show()
|
||||||
|
Reference in New Issue
Block a user