From: GeoSot Date: Tue, 11 May 2021 08:06:32 +0000 (+0300) Subject: Fix offcanvas test to expect the initial body `overflow` value (#33927) X-Git-Tag: v5.0.1~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d1b0fb779e8eb07bab2059167741a0b4ecf4a14;p=thirdparty%2Fbootstrap.git Fix offcanvas test to expect the initial body `overflow` value (#33927) Co-authored-by: XhmikosR --- diff --git a/js/tests/unit/offcanvas.spec.js b/js/tests/unit/offcanvas.spec.js index 64c565318e..dfb6c429e2 100644 --- a/js/tests/unit/offcanvas.spec.js +++ b/js/tests/unit/offcanvas.spec.js @@ -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()