Add a test case for a complex removal

Change-Id: I9e57bf2f1381b1da196308f1cd27c9be58bf8509
This commit is contained in:
Catrope 2012-06-06 15:36:08 -07:00
parent 5e47bdc57f
commit f34b41fe3f

View file

@ -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 );