Преглед изворни кода

Test: Fix editor destroy tests when waiting for a full initialization process. Closes ckeditor/ckeditor5#6138.

Piotrek Koszuliński пре 5 година
родитељ
комит
9fffe1016d
1 измењених фајлова са 10 додато и 5 уклоњено
  1. 10 5
      packages/ckeditor5-core/tests/editor/editor.js

+ 10 - 5
packages/ckeditor5-core/tests/editor/editor.js

@@ -453,14 +453,19 @@ describe( 'Editor', () => {
 			const editor = new TestEditor();
 			const editor = new TestEditor();
 
 
 			editor.on( 'destroy', () => {
 			editor.on( 'destroy', () => {
-				done();
+				spy();
 			} );
 			} );
 
 
-			editor.destroy();
-
-			sinon.assert.notCalled( spy );
+			editor
+				.destroy()
+				.then( () => {
+					done();
+				} );
 
 
-			editor.fire( 'ready' );
+			setTimeout( () => {
+				sinon.assert.notCalled( spy );
+				editor.fire( 'ready' );
+			} );
 		} );
 		} );
 	} );
 	} );