8
0
Pārlūkot izejas kodu

Increased Model class CC.

Oskar Wróbel 8 gadi atpakaļ
vecāks
revīzija
1fdb1b5d31
1 mainītis faili ar 15 papildinājumiem un 0 dzēšanām
  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()', () => {
 		it( 'should destroy document', () => {
 			sinon.spy( model.document, 'destroy' );