diff options
author | Phil Hughes <me@iamphill.com> | 2017-09-25 11:55:33 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-09-25 11:55:33 +0100 |
commit | 1544bc32283d791a5094a6eedc0df344462e2c31 (patch) | |
tree | 4346b02a2a9f7f6712e41a1dcfbe9e2620736c89 /spec/javascripts | |
parent | f389f9081f92b68d8d8369d29e8f05a65f47e9dc (diff) | |
download | gitlab-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.js | 8 |
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); |