瀏覽代碼

Tests: Fixed tests leaking editor instance / DOM element.

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

+ 6 - 6
packages/ckeditor5-alignment/tests/alignmentui.js

@@ -260,9 +260,9 @@ describe( 'Alignment UI', () => {
 		} );
 
 		describe( 'config', () => {
-			beforeEach( () => {
-				element = document.createElement( 'div' );
-				document.body.appendChild( element );
+			beforeEach( async () => {
+				// Clean up the editor created in main test suite hook.
+				await editor.destroy();
 
 				return ClassicTestEditor
 					.create( element, {
@@ -291,9 +291,9 @@ describe( 'Alignment UI', () => {
 				expect( dropdown.buttonView.icon ).to.equal( alignLeftIcon );
 			} );
 
-			it( 'should have default icon set (RTL content)', () => {
-				const element = document.createElement( 'div' );
-				document.body.appendChild( element );
+			it( 'should have default icon set (RTL content)', async () => {
+				// Clean up the editor created in main test suite hook.
+				await editor.destroy();
 
 				return ClassicTestEditor
 					.create( element, {