summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-09-25 11:55:33 +0100
committerPhil Hughes <me@iamphill.com>2017-09-25 11:55:33 +0100
commit1544bc32283d791a5094a6eedc0df344462e2c31 (patch)
tree4346b02a2a9f7f6712e41a1dcfbe9e2620736c89 /spec/javascripts
parentf389f9081f92b68d8d8369d29e8f05a65f47e9dc (diff)
downloadgitlab-ce-1544bc32283d791a5094a6eedc0df344462e2c31.tar.gz
remove the sticky el from the test DOM after each testchanges-bar-dynamic-placeholder
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/lib/utils/sticky_spec.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/javascripts/lib/utils/sticky_spec.js b/spec/javascripts/lib/utils/sticky_spec.js
index 8ddf86c4ee4..b87c836654d 100644
--- a/spec/javascripts/lib/utils/sticky_spec.js
+++ b/spec/javascripts/lib/utils/sticky_spec.js
@@ -4,15 +4,19 @@ describe('sticky', () => {
let el;
beforeEach(() => {
- document.body.innerHTML = `
+ document.body.innerHTML += `
<div class="parent">
- <div id="js-sticky" style="position: relative;"></div>
+ <div id="js-sticky"></div>
</div>
`;
el = document.getElementById('js-sticky');
});
+ afterEach(() => {
+ el.parentNode.remove();
+ });
+
describe('when stuck', () => {
it('does not remove is-stuck class', () => {
isSticky(el, 0, el.offsetTop);