Browse Source

Tests: added additional test for EditingController#destroy.

Szymon Cofalik 9 years ago
parent
commit
29a27e78db
1 changed files with 16 additions and 0 deletions
  1. 16 0
      packages/ckeditor5-engine/tests/controller/editingcontroller.js

+ 16 - 0
packages/ckeditor5-engine/tests/controller/editingcontroller.js

@@ -280,5 +280,21 @@ describe( 'EditingController', () => {
 
 			editing.destroy();
 		} );
+
+		it( 'should destroy view', () => {
+			let model, editing;
+
+			model = new ModelDocument();
+			model.createRoot();
+			model.schema.registerItem( 'paragraph', '$block' );
+
+			editing = new EditingController( model );
+
+			const spy = sinon.spy( editing.view, 'destroy' );
+
+			editing.destroy();
+
+			expect( spy.called ).to.be.true;
+		} );
 	} );
 } );