Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Tests: Fixed tests leaking editor instance / DOM element.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlewand committed Dec 20, 2019
1 parent e52178f commit 452f6c5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/dom/getpositionedancestor.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ describe( 'getPositionedAncestor', () => {
document.body.appendChild( element );
} );

afterEach( () => {
element.remove();
} );

it( 'should return null when there is no element', () => {
expect( getPositionedAncestor() ).to.be.null;
} );
Expand All @@ -38,6 +42,8 @@ describe( 'getPositionedAncestor', () => {
parent.style.position = 'absolute';

expect( getPositionedAncestor( element ) ).to.equal( parent );

parent.remove();
} );

it( 'should find the positioned ancestor (far ancestor)', () => {
Expand All @@ -50,5 +56,7 @@ describe( 'getPositionedAncestor', () => {
parentA.style.position = 'absolute';

expect( getPositionedAncestor( element ) ).to.equal( parentA );

parentA.remove();
} );
} );

0 comments on commit 452f6c5

Please sign in to comment.