|
@@ -3,6 +3,8 @@
|
|
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
|
|
+/* globals console */
|
|
|
|
|
+
|
|
|
import { transform, transformSets } from '../../../src/model/operation/transform';
|
|
import { transform, transformSets } from '../../../src/model/operation/transform';
|
|
|
|
|
|
|
|
import Model from '../../../src/model/model';
|
|
import Model from '../../../src/model/model';
|
|
@@ -61,6 +63,8 @@ describe( 'transform', () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
it( 'should throw an error when one of operations is invalid', () => {
|
|
it( 'should throw an error when one of operations is invalid', () => {
|
|
|
|
|
+ const consoleWarnStub = sinon.stub( console, 'warn' );
|
|
|
|
|
+
|
|
|
const nodeA = new Node();
|
|
const nodeA = new Node();
|
|
|
const nodeB = new Node();
|
|
const nodeB = new Node();
|
|
|
|
|
|
|
@@ -80,7 +84,9 @@ describe( 'transform', () => {
|
|
|
abRelation: null,
|
|
abRelation: null,
|
|
|
baRelation: null
|
|
baRelation: null
|
|
|
} );
|
|
} );
|
|
|
- } ).to.throw();
|
|
|
|
|
|
|
+ } ).to.throw( TypeError );
|
|
|
|
|
+
|
|
|
|
|
+ sinon.assert.calledWith( consoleWarnStub, 'Error during operation transformation!' );
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
describe( 'InsertOperation', () => {
|
|
describe( 'InsertOperation', () => {
|