|
@@ -315,7 +315,7 @@ describe( 'LiveSelection', () => {
|
|
|
beforeEach( () => {
|
|
beforeEach( () => {
|
|
|
root.removeChildren( 0, root.childCount );
|
|
root.removeChildren( 0, root.childCount );
|
|
|
root.insertChildren( 0, [
|
|
root.insertChildren( 0, [
|
|
|
- new Element( 'ul', [], new Text( 'abcdef' ) ),
|
|
|
|
|
|
|
+ new Element( 'p', [], new Text( 'abcdef' ) ),
|
|
|
new Element( 'p', [], new Text( 'foobar' ) ),
|
|
new Element( 'p', [], new Text( 'foobar' ) ),
|
|
|
new Text( 'xyz' )
|
|
new Text( 'xyz' )
|
|
|
] );
|
|
] );
|
|
@@ -579,17 +579,17 @@ describe( 'LiveSelection', () => {
|
|
|
} );
|
|
} );
|
|
|
|
|
|
|
|
it( 'fix selection range if it ends up in graveyard #3', () => {
|
|
it( 'fix selection range if it ends up in graveyard #3', () => {
|
|
|
- selection.setRanges( [ new Range( new Position( root, [ 1, 2 ] ), new Position( root, [ 1, 4 ] ) ) ] );
|
|
|
|
|
|
|
+ selection.setRanges( [ new Range( new Position( root, [ 1, 1 ] ), new Position( root, [ 1, 2 ] ) ) ] );
|
|
|
|
|
|
|
|
doc.applyOperation( wrapInDelta(
|
|
doc.applyOperation( wrapInDelta(
|
|
|
new RemoveOperation(
|
|
new RemoveOperation(
|
|
|
- new Position( root, [ 0 ] ),
|
|
|
|
|
- 3,
|
|
|
|
|
|
|
+ new Position( root, [ 1 ] ),
|
|
|
|
|
+ 2,
|
|
|
doc.version
|
|
doc.version
|
|
|
)
|
|
)
|
|
|
) );
|
|
) );
|
|
|
|
|
|
|
|
- expect( selection.getFirstPosition().path ).to.deep.equal( [ 0 ] );
|
|
|
|
|
|
|
+ expect( selection.getFirstPosition().path ).to.deep.equal( [ 0, 6 ] );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|
|
|
} );
|
|
} );
|