r103104 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103103‎ | r103104 | r103105 >
Date:01:04, 15 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added test for prepareRemoval which fails atm, because strip doesn't drop nodes that are covered completely.
Modified paths:
  • /trunk/extensions/VisualEditor/tests/es/es.DocumentModel.test.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/tests/es/es.DocumentModel.test.js
@@ -374,6 +374,41 @@
375375 ],
376376 'prepareRemoval works across structural nodes'
377377 );
 378+
 379+ // Test 4
 380+ deepEqual(
 381+ documentModel.prepareRemoval( new es.Range( 3, 24 ) ).getOperations(),
 382+ [
 383+ { 'type': 'retain', 'length': 3 },
 384+ {
 385+ 'type': 'remove',
 386+ 'data': ['c', { 'type': 'textStyle/italic', 'hash': '#textStyle/italic' }]
 387+ },
 388+ { 'type': 'retain', 'length': 4 },
 389+ {
 390+ 'type': 'remove',
 391+ 'data': [{ 'type': 'paragraph' }, 'd', { 'type': '/paragraph' }]
 392+ },
 393+ { 'type': 'retain', 'length': 1 },
 394+ {
 395+ 'type': 'remove',
 396+ 'data': [
 397+ { 'type': 'listItem', 'attributes': { 'styles': ['bullet'] } },
 398+ { 'type': 'paragraph' },
 399+ 'e',
 400+ { 'type': '/paragraph' },
 401+ { 'type': '/listItem' },
 402+ { 'type': 'listItem', 'attributes': { 'styles': ['bullet', 'bullet'] } },
 403+ { 'type': 'paragraph' },
 404+ 'f',
 405+ { 'type': '/paragraph' },
 406+ { 'type': '/listItem' }
 407+ ]
 408+ },
 409+ { 'type': 'retain', 'length': 13 }
 410+ ],
 411+ 'prepareRemoval strips and drops correctly when working accross structural nodes'
 412+ );
378413 } );
379414
380415 test( 'es.DocumentModel.prepareInsertion', 11, function() {

Status & tagging log