浏览代码

Merge pull request #45 from ckeditor/i/6002

Tests: Fixed tests leaking editor instances / DOM elements. See ckeditor/ckeditor5#6002.
Kamil Piechaczek 6 年之前
父节点
当前提交
750ce88bda
共有 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, {