Forráskód Böngészése

Aligned code to with new Batch#setAttributes API.

Oskar Wróbel 8 éve
szülő
commit
24e60dc19f

+ 1 - 1
packages/ckeditor5-undo/tests/redocommand.js

@@ -67,7 +67,7 @@ describe( 'RedoCommand', () => {
 				editor.document.selection.setRanges( [ r( 2, 4 ) ], true );
 				editor.document.selection.setRanges( [ r( 2, 4 ) ], true );
 				batch1 = doc.batch();
 				batch1 = doc.batch();
 				undo.addBatch( batch1 );
 				undo.addBatch( batch1 );
-				batch1.setAttribute( r( 2, 4 ), 'key', 'value' );
+				batch1.setAttribute( 'key', 'value', r( 2, 4 ) );
 
 
 				/*
 				/*
 				 [root]
 				 [root]

+ 4 - 4
packages/ckeditor5-undo/tests/undocommand.js

@@ -56,7 +56,7 @@ describe( 'UndoCommand', () => {
 				editor.document.selection.setRanges( [ r( 2, 4 ) ], true );
 				editor.document.selection.setRanges( [ r( 2, 4 ) ], true );
 				batch1 = doc.batch();
 				batch1 = doc.batch();
 				undo.addBatch( batch1 );
 				undo.addBatch( batch1 );
-				batch1.setAttribute( r( 2, 4 ), 'key', 'value' );
+				batch1.setAttribute( 'key', 'value', r( 2, 4 ) );
 
 
 				/*
 				/*
 				 [root]
 				 [root]
@@ -263,8 +263,8 @@ describe( 'UndoCommand', () => {
 
 
 				undo.addBatch( batch );
 				undo.addBatch( batch );
 
 
-				batch.setAttribute( element, 'foo', 'bar' );
-				batch.setAttribute( root, 'foo', 'bar' );
+				batch.setAttribute( 'foo', 'bar', element );
+				batch.setAttribute( 'foo', 'bar', root );
 
 
 				undo.execute();
 				undo.execute();
 
 
@@ -291,7 +291,7 @@ describe( 'UndoCommand', () => {
 			editor.document.selection.setRanges( [ r( 1, 4 ) ] );
 			editor.document.selection.setRanges( [ r( 1, 4 ) ] );
 			const batch0 = doc.batch();
 			const batch0 = doc.batch();
 			undo.addBatch( batch0 );
 			undo.addBatch( batch0 );
-			batch0.setAttribute( r( 1, 4 ), 'uppercase', true );
+			batch0.setAttribute( 'uppercase', true, r( 1, 4 ) );
 			expect( getCaseText( root ) ).to.equal( 'aBCDef' );
 			expect( getCaseText( root ) ).to.equal( 'aBCDef' );
 
 
 			editor.document.selection.setRanges( [ r( 3, 4 ) ] );
 			editor.document.selection.setRanges( [ r( 3, 4 ) ] );

+ 2 - 2
packages/ckeditor5-undo/tests/undoengine-integration.js

@@ -316,7 +316,7 @@ describe( 'UndoEngine integration', () => {
 			input( '<paragraph>fo[ob]ar</paragraph>' );
 			input( '<paragraph>fo[ob]ar</paragraph>' );
 
 
 			doc.enqueueChanges( () => {
 			doc.enqueueChanges( () => {
-				doc.batch().setAttribute( doc.selection.getFirstRange(), 'bold', true );
+				doc.batch().setAttribute( 'bold', true, doc.selection.getFirstRange() );
 			} );
 			} );
 			output( '<paragraph>fo[<$text bold="true">ob</$text>]ar</paragraph>' );
 			output( '<paragraph>fo[<$text bold="true">ob</$text>]ar</paragraph>' );
 
 
@@ -960,7 +960,7 @@ describe( 'UndoEngine integration', () => {
 
 
 			doc.enqueueChanges( () => {
 			doc.enqueueChanges( () => {
 				doc.batch().remove( p );
 				doc.batch().remove( p );
-				doc.batch().setAttribute( p, 'bold', true );
+				doc.batch().setAttribute( 'bold', true, p );
 			} );
 			} );
 
 
 			editor.execute( 'undo' );
 			editor.execute( 'undo' );