瀏覽代碼

Fixed failing ModelTestEditor test.

Oskar Wróbel 8 年之前
父節點
當前提交
239db1c167

+ 5 - 3
packages/ckeditor5-core/tests/_utils-tests/modeltesteditor.js

@@ -4,6 +4,7 @@
  */
 
 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';
@@ -27,12 +28,13 @@ describe( 'ModelTestEditor', () => {
 			expect( editor.data.processor ).to.be.instanceof( HtmlDataProcessor );
 		} );
 
-		it( 'should disable editing pipeline and clear main root', () => {
+		it( 'should disable editing pipeline', () => {
+			const spy = sinon.spy( EditingController.prototype, 'destroy' );
 			const editor = new ModelTestEditor( { foo: 1 } );
 
-			editor.model.document.createRoot( 'second', 'second' );
+			sinon.assert.calledOnce( spy );
 
-			expect( Array.from( editor.editing.view.roots ) ).to.length( 0 );
+			return editor.destroy();
 		} );
 
 		it( 'creates main root element', () => {

+ 1 - 1
packages/ckeditor5-core/tests/_utils/modeltesteditor.js

@@ -23,7 +23,7 @@ export default class ModelTestEditor extends Editor {
 		// Use the HTML data processor in this editor.
 		this.data.processor = new HtmlDataProcessor();
 
-		// Disable editing pipeline for model editor.
+		// Disable editing pipeline.
 		this.editing.destroy();
 
 		// Create the ("main") root element of the model tree.