Browse Source

Tests: Fixed tests leaking editor instance / DOM element.

Marek Lewandowski 6 years ago
parent
commit
65783629da
1 changed files with 7 additions and 4 deletions
  1. 7 4
      packages/ckeditor5-highlight/tests/highlightui.js

+ 7 - 4
packages/ckeditor5-highlight/tests/highlightui.js

@@ -205,6 +205,10 @@ describe( 'HighlightUI', () => {
 				return localizedEditor();
 			} );
 
+			afterEach( () => {
+
+			} );
+
 			it( 'works for the #buttonView', () => {
 				const buttonView = dropdown.buttonView;
 
@@ -236,13 +240,12 @@ describe( 'HighlightUI', () => {
 						language: 'pl'
 					} )
 					.then( newEditor => {
-						editor = newEditor;
-						dropdown = editor.ui.componentFactory.create( 'highlight' );
-						command = editor.commands.get( 'highlight' );
+						dropdown = newEditor.ui.componentFactory.create( 'highlight' );
+						command = newEditor.commands.get( 'highlight' );
 
 						editorElement.remove();
 
-						return editor.destroy();
+						return newEditor.destroy();
 					} );
 			}
 		} );