Sfoglia il codice sorgente

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

Piotrek Koszuliński 5 anni fa
parent
commit
9fffe1016d
1 ha cambiato i file con 10 aggiunte e 5 eliminazioni
  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();
 
 			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' );
+			} );
 		} );
 	} );