浏览代码

Removed duplicated create() methods from test editors.

Oskar Wróbel 7 年之前
父节点
当前提交
b1bd59c4b8

+ 0 - 36
packages/ckeditor5-core/tests/_utils-tests/modeltesteditor.js

@@ -7,7 +7,6 @@ import Editor from '../../src/editor/editor';
 import EditingController from '@ckeditor/ckeditor5-engine/src/controller/editingcontroller';
 import ModelTestEditor from '../../tests/_utils/modeltesteditor';
 
-import Plugin from '../../src/plugin';
 import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
 import DataApiMixin from '../../src/editor/utils/dataapimixin';
 import RootElement from '@ckeditor/ckeditor5-engine/src/model/rootelement';
@@ -49,41 +48,6 @@ describe( 'ModelTestEditor', () => {
 		} );
 	} );
 
-	describe( 'create', () => {
-		it( 'creates an instance of editor', () => {
-			return ModelTestEditor.create( { foo: 1 } )
-				.then( editor => {
-					expect( editor ).to.be.instanceof( ModelTestEditor );
-
-					expect( editor.config.get( 'foo' ) ).to.equal( 1 );
-				} );
-		} );
-
-		it( 'fires all events in the right order', () => {
-			const fired = [];
-
-			function spy( evt ) {
-				fired.push( evt.name );
-			}
-
-			class EventWatcher extends Plugin {
-				init() {
-					this.editor.on( 'pluginsReady', spy );
-					this.editor.on( 'dataReady', spy );
-					this.editor.on( 'ready', spy );
-				}
-			}
-
-			return ModelTestEditor
-				.create( {
-					plugins: [ EventWatcher ]
-				} )
-				.then( () => {
-					expect( fired ).to.deep.equal( [ 'pluginsReady', 'dataReady', 'ready' ] );
-				} );
-		} );
-	} );
-
 	describe( 'setData', () => {
 		let editor;
 

+ 0 - 36
packages/ckeditor5-core/tests/_utils-tests/virtualtesteditor.js

@@ -6,7 +6,6 @@
 import Editor from '../../src/editor/editor';
 import VirtualTestEditor from '../../tests/_utils/virtualtesteditor';
 
-import Plugin from '../../src/plugin';
 import HtmlDataProcessor from '@ckeditor/ckeditor5-engine/src/dataprocessor/htmldataprocessor';
 import DataApiMixin from '../../src/editor/utils/dataapimixin';
 import RootElement from '@ckeditor/ckeditor5-engine/src/model/rootelement';
@@ -35,39 +34,4 @@ describe( 'VirtualTestEditor', () => {
 			expect( testUtils.isMixed( VirtualTestEditor, DataApiMixin ) ).to.true;
 		} );
 	} );
-
-	describe( 'create', () => {
-		it( 'creates an instance of editor', () => {
-			return VirtualTestEditor.create( { foo: 1 } )
-				.then( editor => {
-					expect( editor ).to.be.instanceof( VirtualTestEditor );
-
-					expect( editor.config.get( 'foo' ) ).to.equal( 1 );
-				} );
-		} );
-
-		it( 'fires all events in the right order', () => {
-			const fired = [];
-
-			function spy( evt ) {
-				fired.push( evt.name );
-			}
-
-			class EventWatcher extends Plugin {
-				init() {
-					this.editor.on( 'pluginsReady', spy );
-					this.editor.on( 'dataReady', spy );
-					this.editor.on( 'ready', spy );
-				}
-			}
-
-			return VirtualTestEditor
-				.create( {
-					plugins: [ EventWatcher ]
-				} )
-				.then( () => {
-					expect( fired ).to.deep.equal( [ 'pluginsReady', 'dataReady', 'ready' ] );
-				} );
-		} );
-	} );
 } );

+ 0 - 22
packages/ckeditor5-core/tests/_utils/modeltesteditor.js

@@ -29,28 +29,6 @@ export default class ModelTestEditor extends Editor {
 		// Create the ("main") root element of the model tree.
 		this.model.document.createRoot();
 	}
-
-	/**
-	 * Creates a virtual, element-less editor instance.
-	 *
-	 * @param {Object} config See {@link core.editor.Editor}'s param.
-	 * @returns {Promise} Promise resolved once editor is ready.
-	 * @returns {core.editor.VirtualTestEditor} return.editor The editor instance.
-	 */
-	static create( config ) {
-		return new Promise( resolve => {
-			const editor = new this( config );
-
-			resolve(
-				editor.initPlugins()
-					.then( () => {
-						editor.fire( 'dataReady' );
-						editor.fire( 'ready' );
-					} )
-					.then( () => editor )
-			);
-		} );
-	}
 }
 
 mix( ModelTestEditor, DataApiMixin );

+ 0 - 22
packages/ckeditor5-core/tests/_utils/virtualtesteditor.js

@@ -26,28 +26,6 @@ export default class VirtualTestEditor extends Editor {
 		// Create the ("main") root element of the model tree.
 		this.model.document.createRoot();
 	}
-
-	/**
-	 * Creates a virtual, element-less editor instance.
-	 *
-	 * @param {Object} config See {@link core.editor.Editor}'s param.
-	 * @returns {Promise} Promise resolved once editor is ready.
-	 * @returns {core.editor.VirtualTestEditor} return.editor The editor instance.
-	 */
-	static create( config ) {
-		return new Promise( resolve => {
-			const editor = new this( config );
-
-			resolve(
-				editor.initPlugins()
-					.then( () => {
-						editor.fire( 'dataReady' );
-						editor.fire( 'ready' );
-					} )
-					.then( () => editor )
-			);
-		} );
-	}
 }
 
 mix( VirtualTestEditor, DataApiMixin );