|
|
@@ -1713,7 +1713,7 @@ describe( 'transform', () => {
|
|
|
expectOperation( transOp[ 0 ], expected );
|
|
|
} );
|
|
|
|
|
|
- it( 'target at offset same as range end boundary: expand range', () => {
|
|
|
+ it( 'target at offset same as range end boundary: no operation update', () => {
|
|
|
let transformBy = new InsertOperation(
|
|
|
new Position( root, [ 2, 2, 6 ] ),
|
|
|
[ nodeA, nodeB ],
|
|
|
@@ -1722,6 +1722,21 @@ describe( 'transform', () => {
|
|
|
|
|
|
let transOp = transform( op, transformBy );
|
|
|
|
|
|
+ expect( transOp.length ).to.equal( 1 );
|
|
|
+ expectOperation( transOp[ 0 ], expected );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'target at offset same as range end boundary (sticky move): expand range', () => {
|
|
|
+ let transformBy = new InsertOperation(
|
|
|
+ new Position( root, [ 2, 2, 6 ] ),
|
|
|
+ [ nodeA, nodeB ],
|
|
|
+ baseVersion
|
|
|
+ );
|
|
|
+
|
|
|
+ op.isSticky = true;
|
|
|
+
|
|
|
+ let transOp = transform( op, transformBy );
|
|
|
+
|
|
|
expected.howMany = 4;
|
|
|
|
|
|
expect( transOp.length ).to.equal( 1 );
|
|
|
@@ -2035,7 +2050,7 @@ describe( 'transform', () => {
|
|
|
expectOperation( transOp[ 0 ], expected );
|
|
|
} );
|
|
|
|
|
|
- it( 'target at start boundary of transforming move range: expand move range', () => {
|
|
|
+ it( 'target at start boundary of transforming move range: increment source offset', () => {
|
|
|
let transformBy = new MoveOperation(
|
|
|
new Position( root, [ 4, 1, 0 ] ),
|
|
|
2,
|
|
|
@@ -2047,12 +2062,31 @@ describe( 'transform', () => {
|
|
|
|
|
|
expect( transOp.length ).to.equal( 1 );
|
|
|
|
|
|
+ expected.sourcePosition.offset = 6;
|
|
|
+
|
|
|
+ expectOperation( transOp[ 0 ], expected );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'target at start boundary of transforming move range (sticky move): expand move range', () => {
|
|
|
+ let transformBy = new MoveOperation(
|
|
|
+ new Position( root, [ 4, 1, 0 ] ),
|
|
|
+ 2,
|
|
|
+ new Position( root, [ 2, 2, 4 ] ),
|
|
|
+ baseVersion
|
|
|
+ );
|
|
|
+
|
|
|
+ op.isSticky = true;
|
|
|
+
|
|
|
+ let transOp = transform( op, transformBy );
|
|
|
+
|
|
|
+ expect( transOp.length ).to.equal( 1 );
|
|
|
+
|
|
|
expected.howMany = 4;
|
|
|
|
|
|
expectOperation( transOp[ 0 ], expected );
|
|
|
} );
|
|
|
|
|
|
- it( 'target at end boundary of transforming move range: expand move range', () => {
|
|
|
+ it( 'target at end boundary of transforming move range: no operation update', () => {
|
|
|
let transformBy = new MoveOperation(
|
|
|
new Position( root, [ 4, 1, 0 ] ),
|
|
|
2,
|
|
|
@@ -2062,6 +2096,22 @@ describe( 'transform', () => {
|
|
|
|
|
|
let transOp = transform( op, transformBy );
|
|
|
|
|
|
+ expect( transOp.length ).to.equal( 1 );
|
|
|
+ expectOperation( transOp[ 0 ], expected );
|
|
|
+ } );
|
|
|
+
|
|
|
+ it( 'target at end boundary of transforming move range (sticky move): expand move range', () => {
|
|
|
+ let transformBy = new MoveOperation(
|
|
|
+ new Position( root, [ 4, 1, 0 ] ),
|
|
|
+ 2,
|
|
|
+ new Position( root, [ 2, 2, 6 ] ),
|
|
|
+ baseVersion
|
|
|
+ );
|
|
|
+
|
|
|
+ op.isSticky = true;
|
|
|
+
|
|
|
+ let transOp = transform( op, transformBy );
|
|
|
+
|
|
|
expect( transOp.length ).to.equal( 1 );
|
|
|
|
|
|
expected.howMany = 4;
|