r92657 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92656‎ | r92657 | r92658 >
Date:18:34, 20 July 2011
Author:inez
Status:deferred
Tags:
Comment:
Added tests for getLines method
Modified paths:
  • /trunk/parsers/wikidom/tests/annotations/test.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/tests/annotations/test.js
@@ -55,10 +55,9 @@
5656
5757 /* Tests */
5858
59 -test( 'Content modification', 18, function() {
 59+test( 'Content modification', 17, function() {
6060
61 - deepEqual( content.getLines(), lines, "Content.getLines returns correct array of all lines" );
62 -
 61+
6362 content.on( 'change', function( args ) {
6463 ok( true, 'Change events get triggered after ' + args.type + ' events' );
6564 } );
@@ -98,7 +97,67 @@
9998 content.remove( 5, 8 );
10099 } );
101100
 101+test( 'Content export', 2, function() {
 102+
 103+ deepEqual(
 104+ content.getLines(),
 105+ lines,
 106+ 'Content.getLines returns correct array of all lines'
 107+ );
 108+
 109+ var lines1 = [
 110+ {
 111+ "text": "test1",
 112+ "annotations": [
 113+ {
 114+ "type": "bold",
 115+ "range": {
 116+ "start": 0,
 117+ "end": 4
 118+ }
 119+ },
 120+ {
 121+ "type": "italic",
 122+ "range": {
 123+ "start": 2,
 124+ "end": 4
 125+ }
 126+ }
 127+ ]
 128+ },
 129+ {
 130+ "text": "test2",
 131+ "annotations": [
 132+ {
 133+ "type": "bold",
 134+ "range": {
 135+ "start": 0,
 136+ "end": 4
 137+ }
 138+ },
 139+ {
 140+ "type": "italic",
 141+ "range": {
 142+ "start": 0,
 143+ "end": 2
 144+ }
 145+ }
 146+
 147+ ]
 148+ }
 149+ ];
 150+
 151+ deepEqual(
 152+ Content.newFromLines( lines1 ).getLines(),
 153+ lines1,
 154+ 'Content.getLines returns correct array of all lines for annotations overlapping between lines'
 155+ );
 156+
 157+
 158+} );
 159+
102160 test( 'Content access', 8, function() {
 161+
103162 equal(
104163 content.substring( 3, 39 ),
105164 's is a test paragraph!\nParagraphs ca',

Status & tagging log