8
0
Просмотр исходного кода

Update tests after changes in DocumentSelection attribute update mechanism.

Szymon Kupś 7 лет назад
Родитель
Сommit
ac79020b51
1 измененных файлов с 5 добавлено и 3 удалено
  1. 5 3
      packages/ckeditor5-undo/tests/undoediting-integration.js

+ 5 - 3
packages/ckeditor5-undo/tests/undoediting-integration.js

@@ -323,20 +323,22 @@ describe( 'UndoEditing integration', () => {
 				writer.setAttribute( 'bold', true, doc.selection.getFirstRange() );
 				writer.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>' );
+			expect( doc.selection.getAttribute( 'bold' ) ).to.be.true;
 
 
 			model.change( writer => {
 			model.change( writer => {
 				setSelection( [ 0, 3 ], [ 0, 3 ] );
 				setSelection( [ 0, 3 ], [ 0, 3 ] );
 				writer.insertText( 'zzz', doc.selection.getFirstPosition() );
 				writer.insertText( 'zzz', doc.selection.getFirstPosition() );
 			} );
 			} );
-			output( '<paragraph>fo<$text bold="true">o</$text>zzz<$text bold="true">[]b</$text>ar</paragraph>' );
-			expect( doc.selection.getAttribute( 'bold' ) ).to.true;
+			output( '<paragraph>fo<$text bold="true">o</$text>zzz[]<$text bold="true">b</$text>ar</paragraph>' );
+			expect( doc.selection.getAttribute( 'bold' ) ).to.be.undefined;
 
 
 			editor.execute( 'undo' );
 			editor.execute( 'undo' );
 			output( '<paragraph>fo<$text bold="true">o[]b</$text>ar</paragraph>' );
 			output( '<paragraph>fo<$text bold="true">o[]b</$text>ar</paragraph>' );
-			expect( doc.selection.getAttribute( 'bold' ) ).to.true;
+			expect( doc.selection.getAttribute( 'bold' ) ).to.be.true;
 
 
 			editor.execute( 'undo' );
 			editor.execute( 'undo' );
 			output( '<paragraph>fo[ob]ar</paragraph>' );
 			output( '<paragraph>fo[ob]ar</paragraph>' );
+			expect( doc.selection.getAttribute( 'bold' ) ).to.be.undefined;
 
 
 			undoDisabled();
 			undoDisabled();
 		} );
 		} );