aboutsummaryrefslogtreecommitdiff
path: root/js/tests/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/helpers')
-rw-r--r--js/tests/helpers/fixture.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/js/tests/helpers/fixture.js b/js/tests/helpers/fixture.js
index 0bfc26f46..2ce1081fc 100644
--- a/js/tests/helpers/fixture.js
+++ b/js/tests/helpers/fixture.js
@@ -11,7 +11,7 @@ export const getFixture = () => {
fixtureEl.style.left = '-10000px'
fixtureEl.style.width = '10000px'
fixtureEl.style.height = '10000px'
- document.body.appendChild(fixtureEl)
+ document.body.append(fixtureEl)
}
return fixtureEl
@@ -39,3 +39,12 @@ export const jQueryMock = {
})
}
}
+
+export const clearBodyAndDocument = () => {
+ const attributes = ['data-bs-padding-right', 'style']
+
+ attributes.forEach(attr => {
+ document.documentElement.removeAttribute(attr)
+ document.body.removeAttribute(attr)
+ })
+}