Index: trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js |
— | — | @@ -201,7 +201,7 @@ |
202 | 202 | new es.ParagraphModel( data[25], 1 ) |
203 | 203 | ]; |
204 | 204 | |
205 | | -test( 'es.DocumentModel', 16, function() { |
| 205 | +test( 'es.DocumentModel', 17, function() { |
206 | 206 | var documentModel = es.DocumentModel.newFromPlainObject( obj ); |
207 | 207 | |
208 | 208 | deepEqual( documentModel.getData(), data, 'Flattening plain objects results in correct data' ); |
— | — | @@ -339,5 +339,21 @@ |
340 | 340 | 'prepareContentAnnotation skips over content that is already set or cleared' |
341 | 341 | ); |
342 | 342 | |
| 343 | + deepEqual( |
| 344 | + documentModel.prepareRemoval( new es.Range( 1, 4 ) ), |
| 345 | + [ |
| 346 | + { 'type': 'retain', 'length': 1 }, |
| 347 | + { |
| 348 | + 'type': 'remove', |
| 349 | + 'data': [ |
| 350 | + 'a', |
| 351 | + ['b', { 'type': 'bold', 'hash': '#bold' }], |
| 352 | + ['c', { 'type': 'italic', 'hash': '#italic' }] |
| 353 | + ] |
| 354 | + }, |
| 355 | + { 'type': 'retain', 'length': 25 } |
| 356 | + ], |
| 357 | + 'prepareRemove includes the content being removed' |
| 358 | + ); |
343 | 359 | } ); |
344 | 360 | |