mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-27 04:06:51 +00:00
Add a test case for a complex removal
Change-Id: I9e57bf2f1381b1da196308f1cd27c9be58bf8509
This commit is contained in:
parent
5e47bdc57f
commit
f34b41fe3f
|
@ -364,6 +364,30 @@ test( 'newFromRemoval', function() {
|
||||||
},
|
},
|
||||||
{ 'type': 'retain', 'length': 2 }
|
{ '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 );
|
ve.dm.Transaction.runConstructorTests( ve.dm.Transaction.newFromRemoval, cases );
|
||||||
|
|
Loading…
Reference in a new issue