8
0
Просмотр исходного кода

Tests: Create and remove the editor correctly in the tests.

Piotrek Koszuliński 8 лет назад
Родитель
Сommit
43cbf85d66
1 измененных файлов с 9 добавлено и 2 удалено
  1. 9 2
      packages/ckeditor5-undo/tests/undo.js

+ 9 - 2
packages/ckeditor5-undo/tests/undo.js

@@ -15,10 +15,11 @@ import { keyCodes } from '@ckeditor/ckeditor5-utils/src/keyboard';
 testUtils.createSinonSandbox();
 
 describe( 'Undo', () => {
-	let editor;
+	let editor, editorElement;
 
 	beforeEach( () => {
-		const editorElement = document.createElement( 'div' );
+		editorElement = document.createElement( 'div' );
+		document.body.appendChild( editorElement );
 
 		return ClassicTestEditor.create( editorElement, {
 				plugins: [ Undo ]
@@ -28,6 +29,12 @@ describe( 'Undo', () => {
 			} );
 	} );
 
+	afterEach( () => {
+		editorElement.remove();
+
+		return editor.destroy();
+	} );
+
 	it( 'should be loaded', () => {
 		expect( editor.plugins.get( Undo ) ).to.be.instanceOf( Undo );
 	} );