From f34b41fe3f3515c4faf0506cfa485bac684f87ff Mon Sep 17 00:00:00 2001 From: Catrope Date: Wed, 6 Jun 2012 15:36:08 -0700 Subject: [PATCH] Add a test case for a complex removal Change-Id: I9e57bf2f1381b1da196308f1cd27c9be58bf8509 --- tests/ve2/dm/ve.dm.Transaction.test.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/ve2/dm/ve.dm.Transaction.test.js b/tests/ve2/dm/ve.dm.Transaction.test.js index bcaf1157b3..ba402dd68a 100644 --- a/tests/ve2/dm/ve.dm.Transaction.test.js +++ b/tests/ve2/dm/ve.dm.Transaction.test.js @@ -364,6 +364,30 @@ test( 'newFromRemoval', function() { }, { 'type': 'retain', 'length': 2 } ] + }, + 'removing from a heading into a paragraph': { + 'args': [doc, new ve.Range( 2, 55 )], + 'ops': [ + { 'type': 'retain', 'length': 2 }, + { + 'type': 'replace', + 'remove': doc.getData().slice( 2, 4 ), + 'insert': [] + }, + { 'type': 'retain', 'length': 1 }, + { + 'type': 'replace', + 'remove': doc.getData().slice( 5, 53 ), + 'insert': [] + }, + { 'type': 'retain', 'length': 1 }, + { + 'type': 'replace', + 'remove': ['l'], + 'insert': [] + }, + { 'type': 'retain', 'length': 4 } + ] } }; ve.dm.Transaction.runConstructorTests( ve.dm.Transaction.newFromRemoval, cases );