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

Commit

Permalink
Tests: fixed tests after changes in RemoveOperation transformation.…
Browse files Browse the repository at this point in the history
… Added new tests for undo integration.
  • Loading branch information
scofalik committed Jul 6, 2017
1 parent a5150d6 commit 9257211
Show file tree
Hide file tree
Showing 2 changed files with 378 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/undocommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,11 @@ describe( 'UndoCommand', () => {
expect( char.hasAttribute( 'key' ) ).to.be.false;
}

// Let's undo wrapping. This will bring back some nodes that were wrapped into the paragraph at the beginning.
// Let's undo wrapping. This will remove the P element and leave us with empty root.
undo.execute( batch3 );
expect( root.maxOffset ).to.equal( 3 );
expect( root.getChild( 0 ).data ).to.equal( 'bar' );
expect( root.maxOffset ).to.equal( 0 );

expect( editor.document.selection.getFirstRange().isEqual( r( 0, 3 ) ) ).to.be.true;
expect( editor.document.selection.getFirstRange().isEqual( r( 0, 0 ) ) ).to.be.true;
expect( editor.document.selection.isBackward ).to.be.false;
} );
} );
Expand Down
Loading

0 comments on commit 9257211

Please sign in to comment.