r99437 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99436‎ | r99437 | r99438 >
Date:21:56, 10 October 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Added test case for prepareRemoval, which currently fails since that function is not complete yet.
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
@@ -201,7 +201,7 @@
202202 new es.ParagraphModel( data[25], 1 )
203203 ];
204204
205 -test( 'es.DocumentModel', 16, function() {
 205+test( 'es.DocumentModel', 17, function() {
206206 var documentModel = es.DocumentModel.newFromPlainObject( obj );
207207
208208 deepEqual( documentModel.getData(), data, 'Flattening plain objects results in correct data' );
@@ -339,5 +339,21 @@
340340 'prepareContentAnnotation skips over content that is already set or cleared'
341341 );
342342
 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+ );
343359 } );
344360

Status & tagging log