http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99494

Revision: 99494
Author:   catrope
Date:     2011-10-11 16:46:31 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
Moar tests

Modified Paths:
--------------
    trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js

Modified: trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js
===================================================================
--- trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js   2011-10-11 
16:45:33 UTC (rev 99493)
+++ trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js   2011-10-11 
16:46:31 UTC (rev 99494)
@@ -374,6 +374,22 @@
        );
        
        deepEqual(
+               documentModel.prepareRemoval( new es.Range( 17, 19 ) ),
+               [
+                       { 'type': 'retain', 'length': 17 },
+                       {
+                               'type': 'remove',
+                               'data': [
+                                       { 'type': '/listItem' },
+                                       { 'type': 'listItem', 'attributes': { 
'styles': ['number'] } }
+                               ]
+                       },
+                       { 'type': 'retain', 'length': 9 }
+               ],
+               'prepareRemoval merges two list items'
+       ); 
+       
+       deepEqual(
                documentModel.prepareInsertion( 1, ['d', 'e', 'f'] ),
                [
                        { 'type': 'retain', 'length': 1 },
@@ -382,4 +398,14 @@
                ],
                'prepareInsertion retains data up to the offset and includes 
the content being inserted'
        );
+       
+       deepEqual(
+               documentModel.prepareInsertion( 5, [ { 'type': 'paragraph' }, 
'd', 'e', 'f', { 'type': '/paragraph' } ] ),
+               [
+                       { 'type': 'retain', 'length': 5 },
+                       { 'type': 'insert', 'data': [ { 'type': 'paragraph' }, 
'd', 'e', 'f', { 'type': '/paragraph' } ] },
+                       { 'type': 'retain', 'length': 23 }
+               ],
+               'prepareInsertion inserts a paragraph between two structural 
elements'
+       );
 } );


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to