remove the sticky el from the test DOM after each test
This commit is contained in:
parent
f389f9081f
commit
1544bc3228
1 changed files with 6 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue