r99494 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99493‎ | r99494 | r99495 >
Date:16:46, 11 October 2011
Author:catrope
Status:deferred
Tags:
Comment:
Moar tests
Modified paths:
  • /trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js
@@ -374,6 +374,22 @@
375375 );
376376
377377 deepEqual(
 378+ documentModel.prepareRemoval( new es.Range( 17, 19 ) ),
 379+ [
 380+ { 'type': 'retain', 'length': 17 },
 381+ {
 382+ 'type': 'remove',
 383+ 'data': [
 384+ { 'type': '/listItem' },
 385+ { 'type': 'listItem', 'attributes': { 'styles': ['number'] } }
 386+ ]
 387+ },
 388+ { 'type': 'retain', 'length': 9 }
 389+ ],
 390+ 'prepareRemoval merges two list items'
 391+ );
 392+
 393+ deepEqual(
378394 documentModel.prepareInsertion( 1, ['d', 'e', 'f'] ),
379395 [
380396 { 'type': 'retain', 'length': 1 },
@@ -382,4 +398,14 @@
383399 ],
384400 'prepareInsertion retains data up to the offset and includes the content being inserted'
385401 );
 402+
 403+ deepEqual(
 404+ documentModel.prepareInsertion( 5, [ { 'type': 'paragraph' }, 'd', 'e', 'f', { 'type': '/paragraph' } ] ),
 405+ [
 406+ { 'type': 'retain', 'length': 5 },
 407+ { 'type': 'insert', 'data': [ { 'type': 'paragraph' }, 'd', 'e', 'f', { 'type': '/paragraph' } ] },
 408+ { 'type': 'retain', 'length': 23 }
 409+ ],
 410+ 'prepareInsertion inserts a paragraph between two structural elements'
 411+ );
386412 } );

Status & tagging log