[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests
jenkins-bot has submitted this change and it was merged. Change subject: Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests .. Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests They were harmless because the function returned an object which supplants the spurious one 'new' creates. Change-Id: I46a6b8cf072f342c81eeb01e6659f2f0500445d6 --- M tests/dm/ve.dm.Surface.test.js 1 file changed, 11 insertions(+), 11 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/dm/ve.dm.Surface.test.js b/tests/dm/ve.dm.Surface.test.js index c82285e..48cd63f 100644 --- a/tests/dm/ve.dm.Surface.test.js +++ b/tests/dm/ve.dm.Surface.test.js @@ -60,7 +60,7 @@ fragment = surface.getFragment(), doc = surface.getDocument(), selection = new ve.dm.LinearSelection( doc, range ), - tx = new ve.dm.Transaction.newFromInsertion( doc, 1, [ 'x' ] ); + tx = ve.dm.Transaction.newFromInsertion( doc, 1, [ 'x' ] ); assert.strictEqual( surface.breakpoint(), false, 'Returns false if no transactions applied' ); @@ -106,14 +106,14 @@ assert.strictEqual( surface.doesStagingAllowUndo(), undefined, 'doesStagingAllowUndo undefined when not staging' ); assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface range matches fragment range' ); - surface.change( new ve.dm.Transaction.newFromInsertion( doc, 1, [ 'a' ] ) ); + surface.change( ve.dm.Transaction.newFromInsertion( doc, 1, [ 'a' ] ) ); surface.pushStaging(); assert.strictEqual( surface.isStaging(), true, 'isStaging true after pushStaging' ); assert.deepEqual( surface.getStagingTransactions(), [], 'getStagingTransactions empty array after pushStaging' ); assert.strictEqual( surface.doesStagingAllowUndo(), false, 'doesStagingAllowUndo false when staging without undo' ); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); assert.strictEqual( fragment.getText(), 'abhi', 'document contents match after first transaction' ); @@ -126,7 +126,7 @@ assert.strictEqual( surface.doesStagingAllowUndo(), true, 'doesStagingAllowUndo true when staging with undo' ); assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); assert.strictEqual( fragment.getText(), 'abchi', 'document contents match after second transaction' ); @@ -143,11 +143,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); assert.deepEqual( surface.popAllStaging(), [ tx1, tx2 ], 'popAllStaging returns full transaction list' ); @@ -155,11 +155,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); surface.applyStaging(); @@ -171,11 +171,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 4, [ 'd' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 4, [ 'd' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 5, [ 'e' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 5, [ 'e' ] ); surface.change( tx2 ); surface.applyAllStaging(); @@ -190,7 +190,7 @@ surface.pushStaging(); surface.pushStaging(); // Apply transaction at second level, first level is empty and has no selctionBefore - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 4, [ 'd' ] ); + tx1 =
[MediaWiki-commits] [Gerrit] VisualEditor/VisualEditor[master]: Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests
Divec has uploaded a new change for review. https://gerrit.wikimedia.org/r/310544 Change subject: Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests .. Fix 'new ve.dm.Transaction.newFromInsertion' typos in tests They were harmless because the function returned an object which supplants the spurious one 'new' creates. Change-Id: I46a6b8cf072f342c81eeb01e6659f2f0500445d6 --- M tests/dm/ve.dm.Surface.test.js 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/VisualEditor/VisualEditor refs/changes/44/310544/1 diff --git a/tests/dm/ve.dm.Surface.test.js b/tests/dm/ve.dm.Surface.test.js index c82285e..48cd63f 100644 --- a/tests/dm/ve.dm.Surface.test.js +++ b/tests/dm/ve.dm.Surface.test.js @@ -60,7 +60,7 @@ fragment = surface.getFragment(), doc = surface.getDocument(), selection = new ve.dm.LinearSelection( doc, range ), - tx = new ve.dm.Transaction.newFromInsertion( doc, 1, [ 'x' ] ); + tx = ve.dm.Transaction.newFromInsertion( doc, 1, [ 'x' ] ); assert.strictEqual( surface.breakpoint(), false, 'Returns false if no transactions applied' ); @@ -106,14 +106,14 @@ assert.strictEqual( surface.doesStagingAllowUndo(), undefined, 'doesStagingAllowUndo undefined when not staging' ); assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface range matches fragment range' ); - surface.change( new ve.dm.Transaction.newFromInsertion( doc, 1, [ 'a' ] ) ); + surface.change( ve.dm.Transaction.newFromInsertion( doc, 1, [ 'a' ] ) ); surface.pushStaging(); assert.strictEqual( surface.isStaging(), true, 'isStaging true after pushStaging' ); assert.deepEqual( surface.getStagingTransactions(), [], 'getStagingTransactions empty array after pushStaging' ); assert.strictEqual( surface.doesStagingAllowUndo(), false, 'doesStagingAllowUndo false when staging without undo' ); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); assert.strictEqual( fragment.getText(), 'abhi', 'document contents match after first transaction' ); @@ -126,7 +126,7 @@ assert.strictEqual( surface.doesStagingAllowUndo(), true, 'doesStagingAllowUndo true when staging with undo' ); assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); assert.strictEqual( fragment.getText(), 'abchi', 'document contents match after second transaction' ); @@ -143,11 +143,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); assert.deepEqual( surface.popAllStaging(), [ tx1, tx2 ], 'popAllStaging returns full transaction list' ); @@ -155,11 +155,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 2, [ 'b' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 3, [ 'c' ] ); surface.change( tx2 ); surface.applyStaging(); @@ -171,11 +171,11 @@ assert.equalHash( surface.getSelection(), fragment.getSelection(), 'Surface selection matches fragment range' ); surface.pushStaging(); - tx1 = new ve.dm.Transaction.newFromInsertion( doc, 4, [ 'd' ] ); + tx1 = ve.dm.Transaction.newFromInsertion( doc, 4, [ 'd' ] ); surface.change( tx1 ); surface.pushStaging(); - tx2 = new ve.dm.Transaction.newFromInsertion( doc, 5, [ 'e' ] ); + tx2 = ve.dm.Transaction.newFromInsertion( doc, 5, [ 'e' ] ); surface.change( tx2 ); surface.applyAllStaging(); @@ -190,7 +190,7 @@ surface.pushStaging(); surface.pushStaging(); // Apply transaction at second level, first level is empty and has no selctionBefore - tx1 = new