Browse Source

Increased Model class CC.

Oskar Wróbel 8 years ago
parent
commit
1fdb1b5d31
1 changed files with 15 additions and 0 deletions
  1. 15 0
      packages/ckeditor5-engine/tests/model/model.js

+ 15 - 0
packages/ckeditor5-engine/tests/model/model.js

@@ -306,6 +306,21 @@ describe( 'Model', () => {
 		} );
 		} );
 	} );
 	} );
 
 
+	describe( 'applyOperation', () => {
+		it( 'should execute provided operation end return the result of operation', () => {
+			const returnValue = { foo: 'bar' };
+
+			const operation = {
+				_execute: sinon.stub().returns( returnValue )
+			};
+
+			model.applyOperation( operation );
+
+			sinon.assert.calledOnce( operation._execute );
+			expect( model.applyOperation( operation ) ).to.equal( returnValue );
+		} );
+	} );
+
 	describe( 'destroy()', () => {
 	describe( 'destroy()', () => {
 		it( 'should destroy document', () => {
 		it( 'should destroy document', () => {
 			sinon.spy( model.document, 'destroy' );
 			sinon.spy( model.document, 'destroy' );