diff --git a/tests/_utils-tests/classictesteditorui.js b/tests/_utils-tests/classictesteditorui.js index f397c64b..5b51679c 100644 --- a/tests/_utils-tests/classictesteditorui.js +++ b/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 ); } ); } ); } ); diff --git a/tests/_utils/classictesteditor.js b/tests/_utils/classictesteditor.js index 271edad2..af9ec164 100644 --- a/tests/_utils/classictesteditor.js +++ b/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( () => { diff --git a/tests/_utils/classictesteditorui.js b/tests/_utils/classictesteditorui.js index 92b9e80e..2cb42d23 100644 --- a/tests/_utils/classictesteditorui.js +++ b/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(); } }