8
0
Pārlūkot izejas kodu

Tests: Added additional test for model.Differ.

Szymon Cofalik 7 gadi atpakaļ
vecāks
revīzija
e3516ab1f9
1 mainītis faili ar 12 papildinājumiem un 0 dzēšanām
  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 );