Commit 1544bc32 authored by Phil Hughes's avatar Phil Hughes

remove the sticky el from the test DOM after each test

parent f389f908
...@@ -4,15 +4,19 @@ describe('sticky', () => { ...@@ -4,15 +4,19 @@ describe('sticky', () => {
let el; let el;
beforeEach(() => { beforeEach(() => {
document.body.innerHTML = ` document.body.innerHTML += `
<div class="parent"> <div class="parent">
<div id="js-sticky" style="position: relative;"></div> <div id="js-sticky"></div>
</div> </div>
`; `;
el = document.getElementById('js-sticky'); el = document.getElementById('js-sticky');
}); });
afterEach(() => {
el.parentNode.remove();
});
describe('when stuck', () => { describe('when stuck', () => {
it('does not remove is-stuck class', () => { it('does not remove is-stuck class', () => {
isSticky(el, 0, el.offsetTop); isSticky(el, 0, el.offsetTop);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment