浏览代码

Tests: Added additional test for model.Differ.

Szymon Cofalik 7 年之前
父节点
当前提交
e3516ab1f9
共有 1 个文件被更改,包括 12 次插入0 次删除
  1. 12 0
      packages/ckeditor5-engine/tests/model/differ.js

+ 12 - 0
packages/ckeditor5-engine/tests/model/differ.js

@@ -533,6 +533,18 @@ describe( 'Differ', () => {
 			] );
 		} );
 
+		it( 'on an element - only one of many attributes changes', () => {
+			root.getChild( 0 ).setAttribute( 'otherAttr', true );
+
+			const range = Range.createFromParentsAndOffsets( root, 0, root.getChild( 0 ), 0 );
+
+			attribute( range, attributeKey, attributeOldValue, attributeNewValue );
+
+			expectChanges( [
+				{ type: 'attribute', range, attributeKey, attributeOldValue, attributeNewValue }
+			] );
+		} );
+
 		it( 'on a character', () => {
 			const parent = root.getChild( 1 );
 			const range = Range.createFromParentsAndOffsets( parent, 1, parent, 2 );