8
0
Просмотр исходного кода

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

Piotrek Koszuliński 5 лет назад
Родитель
Сommit
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();
 
 			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' );
+			} );
 		} );
 	} );