Browse Source

Internal: Used `forceWeakRemove` flag in undo OT.

Szymon Cofalik 6 years ago
parent
commit
4134be2750

+ 2 - 1
packages/ckeditor5-undo/src/basecommand.js

@@ -148,7 +148,8 @@ export default class BaseCommand extends Command {
 				{
 					useRelations: true,
 					document: this.editor.model.document,
-					padWithNoOps: false
+					padWithNoOps: false,
+					forceWeakRemove: true
 				}
 			);
 

+ 0 - 7
packages/ckeditor5-undo/tests/undocommand.js

@@ -266,13 +266,6 @@ describe( 'UndoCommand', () => {
 				for ( const item of model.createRangeIn( doc.graveyard ).getItems() ) {
 					expect( item.hasAttribute( 'key' ) ).to.be.false;
 				}
-
-				// Let's undo wrapping. This will remove the P element and leave us with empty root.
-				undo.execute( batch3 );
-				expect( root.maxOffset ).to.equal( 0 );
-
-				expect( editor.model.document.selection.getFirstRange().isEqual( r( 0, 0 ) ) ).to.be.true;
-				expect( editor.model.document.selection.isBackward ).to.be.false;
 			} );
 
 			it( 'should omit deltas with non-document operations', () => {