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

Commit

Permalink
Merge pull request #318 from ckeditor/i/6002
Browse files Browse the repository at this point in the history
Tests: Fixed tests leaking editor instances / DOM elements. See ckeditor/ckeditor5#6002.
  • Loading branch information
pomek committed Dec 20, 2019
2 parents e52178f + 452f6c5 commit 98a47ee
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 98a47ee

Please sign in to comment.