Преглед на файлове

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 );