aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/offcanvas.spec.js
diff options
context:
space:
mode:
authorGeoSot <[email protected]>2021-04-25 06:50:16 +0300
committerGitHub <[email protected]>2021-04-25 06:50:16 +0300
commitd381820d1678044257fe2cb7b2f178d1f001ed30 (patch)
tree30dc7fbf20326cfbf73326258db7880051bb53b5 /js/tests/unit/offcanvas.spec.js
parente2294ff0902e4efba94a1635729670a8aa510ded (diff)
downloadbootstrap-d381820d1678044257fe2cb7b2f178d1f001ed30.tar.xz
bootstrap-d381820d1678044257fe2cb7b2f178d1f001ed30.zip
Scrollbar: respect the initial body overflow value (#33706)
* add method to handle overflow on body element & tests * replace duplicated code on modal/offcanvas tests
Diffstat (limited to 'js/tests/unit/offcanvas.spec.js')
-rw-r--r--js/tests/unit/offcanvas.spec.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/js/tests/unit/offcanvas.spec.js b/js/tests/unit/offcanvas.spec.js
index 2419e5723..30edc2913 100644
--- a/js/tests/unit/offcanvas.spec.js
+++ b/js/tests/unit/offcanvas.spec.js
@@ -2,7 +2,7 @@ import Offcanvas from '../../src/offcanvas'
import EventHandler from '../../src/dom/event-handler'
/** Test helpers */
-import { clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
+import { clearBodyAndDocument, clearFixture, createEvent, getFixture, jQueryMock } from '../helpers/fixture'
import { isVisible } from '../../src/util'
describe('Offcanvas', () => {
@@ -15,15 +15,11 @@ describe('Offcanvas', () => {
afterEach(() => {
clearFixture()
document.body.classList.remove('offcanvas-open')
- document.documentElement.removeAttribute('style')
- document.body.removeAttribute('style')
- document.body.removeAttribute('data-bs-padding-right')
+ clearBodyAndDocument()
})
beforeEach(() => {
- document.documentElement.removeAttribute('style')
- document.body.removeAttribute('style')
- document.body.removeAttribute('data-bs-padding-right')
+ clearBodyAndDocument()
})
describe('VERSION', () => {