]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Fix offcanvas test to expect the initial body `overflow` value (#33927)
authorGeoSot <geo.sotis@gmail.com>
Tue, 11 May 2021 08:06:32 +0000 (11:06 +0300)
committerGitHub <noreply@github.com>
Tue, 11 May 2021 08:06:32 +0000 (11:06 +0300)
Co-authored-by: XhmikosR <xhmikosr@gmail.com>
js/tests/unit/offcanvas.spec.js

index 64c565318eaf4ab6fe5854eccff36f752d210364..dfb6c429e2e56618e02b3c97dbeee5c1510a68e3 100644 (file)
@@ -180,6 +180,7 @@ describe('Offcanvas', () => {
 
       const offCanvasEl = fixtureEl.querySelector('.offcanvas')
       const offCanvas = new Offcanvas(offCanvasEl, { scroll: false })
+      const initialOverFlow = document.body.style.overflow
 
       offCanvasEl.addEventListener('shown.bs.offcanvas', () => {
         expect(document.body.style.overflow).toEqual('hidden')
@@ -187,7 +188,7 @@ describe('Offcanvas', () => {
         offCanvas.hide()
       })
       offCanvasEl.addEventListener('hidden.bs.offcanvas', () => {
-        expect(document.body.style.overflow).not.toEqual('hidden')
+        expect(document.body.style.overflow).toEqual(initialOverFlow)
         done()
       })
       offCanvas.show()