Procházet zdrojové kódy

Tests: Fixed broken tests due to double editor destruction.

Aleksander Nowodzinski před 6 roky
rodič
revize
66b46eaa09

+ 6 - 12
packages/ckeditor5-editor-inline/tests/inlineeditorui.js

@@ -140,13 +140,11 @@ describe( 'InlineEditorUI', () => {
 						placeholder: 'placeholder-text',
 					} )
 					.then( newEditor => {
-						editor = newEditor;
-
-						const firstChild = editor.editing.view.document.getRoot().getChild( 0 );
+						const firstChild = newEditor.editing.view.document.getRoot().getChild( 0 );
 
 						expect( firstChild.getAttribute( 'data-placeholder' ) ).to.equal( 'placeholder-text' );
 
-						return editor.destroy();
+						return newEditor.destroy();
 					} );
 			} );
 
@@ -160,13 +158,11 @@ describe( 'InlineEditorUI', () => {
 						extraPlugins: [ Paragraph ]
 					} )
 					.then( newEditor => {
-						editor = newEditor;
-
-						const firstChild = editor.editing.view.document.getRoot().getChild( 0 );
+						const firstChild = newEditor.editing.view.document.getRoot().getChild( 0 );
 
 						expect( firstChild.getAttribute( 'data-placeholder' ) ).to.equal( 'placeholder-text' );
 
-						return editor.destroy();
+						return newEditor.destroy();
 					} );
 			} );
 
@@ -181,13 +177,11 @@ describe( 'InlineEditorUI', () => {
 						extraPlugins: [ Paragraph ]
 					} )
 					.then( newEditor => {
-						editor = newEditor;
-
-						const firstChild = editor.editing.view.document.getRoot().getChild( 0 );
+						const firstChild = newEditor.editing.view.document.getRoot().getChild( 0 );
 
 						expect( firstChild.getAttribute( 'data-placeholder' ) ).to.equal( 'config takes precedence' );
 
-						return editor.destroy();
+						return newEditor.destroy();
 					} );
 			} );
 		} );