瀏覽代碼

Tests: Fixed tests leaking editor instance / DOM element.

Marek Lewandowski 6 年之前
父節點
當前提交
f35a1ef29a
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      packages/ckeditor5-utils/tests/dom/getpositionedancestor.js

+ 8 - 0
packages/ckeditor5-utils/tests/dom/getpositionedancestor.js

@@ -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;
 	} );
@@ -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)', () => {
@@ -50,5 +56,7 @@ describe( 'getPositionedAncestor', () => {
 		parentA.style.position = 'absolute';
 
 		expect( getPositionedAncestor( element ) ).to.equal( parentA );
+
+		parentA.remove();
 	} );
 } );