8
0
Quellcode durchsuchen

Aligned Core package to the synchronous UI API.

Aleksander Nowodzinski vor 8 Jahren
Ursprung
Commit
876577e5b9

+ 5 - 18
packages/ckeditor5-core/tests/_utils-tests/classictesteditorui.js

@@ -36,34 +36,21 @@ describe( 'ClassicTestEditorUI', () => {
 	} );
 
 	describe( 'init()', () => {
-		it( 'returns a promise', () => {
-			expect( ui.init() ).to.be.instanceof( Promise );
-		} );
-
 		it( 'initializes the #view', () => {
 			const spy = sinon.spy( view, 'init' );
 
-			return ui.init().then( () => {
-				sinon.assert.calledOnce( spy );
-			} );
+			ui.init();
+			sinon.assert.calledOnce( spy );
 		} );
 	} );
 
 	describe( 'destroy()', () => {
-		it( 'returns a promise', () => {
-			return ui.init().then( () => {
-				expect( ui.destroy() ).to.be.instanceof( Promise );
-			} );
-		} );
-
 		it( 'destroys the #view', () => {
 			const spy = sinon.spy( view, 'destroy' );
 
-			return ui.init()
-				.then( () => ui.destroy() )
-				.then( () => {
-					sinon.assert.calledOnce( spy );
-				} );
+			ui.init();
+			ui.destroy();
+			sinon.assert.calledOnce( spy );
 		} );
 	} );
 } );

+ 6 - 4
packages/ckeditor5-core/tests/_utils/classictesteditor.js

@@ -42,9 +42,9 @@ export default class ClassicTestEditor extends StandardEditor {
 	 */
 	destroy() {
 		this._elementReplacer.restore();
+		this.ui.destroy();
 
-		return super.destroy()
-			.then( () => this.ui.destroy() );
+		return super.destroy();
 	}
 
 	/**
@@ -57,8 +57,10 @@ export default class ClassicTestEditor extends StandardEditor {
 			resolve(
 				editor.initPlugins()
 					.then( () => editor._elementReplacer.replace( element, editor.ui.view.element ) )
-					.then( () => editor.ui.init() )
-					.then( () => editor.fire( 'uiReady' ) )
+					.then( () => {
+						editor.ui.init();
+						editor.fire( 'uiReady' );
+					} )
 					.then( () => editor.editing.view.attachDomRoot( editor.ui.view.editableElement ) )
 					.then( () => editor.loadDataFromEditorElement() )
 					.then( () => {

+ 2 - 2
packages/ckeditor5-core/tests/_utils/classictesteditorui.js

@@ -58,7 +58,7 @@ export default class ClassicTestEditorUI {
 	 * @returns {Promise} A Promise resolved when the initialization process is finished.
 	 */
 	init() {
-		return this.view.init();
+		this.view.init();
 	}
 
 	/**
@@ -67,6 +67,6 @@ export default class ClassicTestEditorUI {
 	 * @returns {Promise} A Promise resolved when the destruction process is finished.
 	 */
 	destroy() {
-		return this.view.destroy();
+		this.view.destroy();
 	}
 }