Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #83 from ckeditor/t/ckeditor5-engine/1267
Browse files Browse the repository at this point in the history
Internal: Align to changes made in DocumentSelection. See ckeditor/ckeditor5-engine#1343.
  • Loading branch information
scofalik committed Mar 8, 2018
2 parents 27f0527 + cd19aed commit 8ae86bd
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/undoediting-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,20 +323,22 @@ describe( 'UndoEditing integration', () => {
writer.setAttribute( 'bold', true, doc.selection.getFirstRange() );
} );
output( '<paragraph>fo[<$text bold="true">ob</$text>]ar</paragraph>' );
expect( doc.selection.getAttribute( 'bold' ) ).to.be.true;

model.change( writer => {
setSelection( [ 0, 3 ], [ 0, 3 ] );
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' );
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' );
output( '<paragraph>fo[ob]ar</paragraph>' );
expect( doc.selection.getAttribute( 'bold' ) ).to.be.undefined;

undoDisabled();
} );
Expand Down

0 comments on commit 8ae86bd

Please sign in to comment.