Przeglądaj źródła

Merge pull request #11 from ckeditor/i/6002

Tests: Fixed tests leaking editor instances / DOM elements. See ckeditor/ckeditor5#6002.
Kamil Piechaczek 6 lat temu
rodzic
commit
d111a5c2ca

+ 3 - 2
packages/ckeditor5-restricted-editing/tests/standardeditingmodeui.js

@@ -14,12 +14,12 @@ import StandardEditingModeUI from '../src/standardeditingmodeui';
 import StandardEditingModeEditing from '../src/standardeditingmodeediting';
 
 describe( 'StandardEditingModeUI', () => {
-	let editor, buttonView;
+	let editor, buttonView, editorElement;
 
 	testUtils.createSinonSandbox();
 
 	beforeEach( async () => {
-		const editorElement = document.createElement( 'div' );
+		editorElement = document.createElement( 'div' );
 		document.body.appendChild( editorElement );
 
 		editor = await ClassicTestEditor.create( editorElement, {
@@ -30,6 +30,7 @@ describe( 'StandardEditingModeUI', () => {
 	} );
 
 	afterEach( () => {
+		editorElement.remove();
 		return editor.destroy();
 	} );