http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99740
Revision: 99740
Author: tparscal
Date: 2011-10-13 22:37:50 +0000 (Thu, 13 Oct 2011)
Log Message:
-----------
Added some more tests for insertion, including adding a missing close element
and wrapping unstructured content in a paragraph
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-13
22:26:24 UTC (rev 99739)
+++ trunk/parsers/wikidom/tests/hype/es.DocumentModel.test.js 2011-10-13
22:37:50 UTC (rev 99740)
@@ -414,4 +414,36 @@
],
'prepareInsertion inserts a paragraph between two structural
elements'
);
+
+ deepEqual(
+ documentModel.prepareInsertion(
+ 5,
+ ['d', 'e', 'f']
+ ),
+ [
+ { 'type': 'retain', 'length': 5 },
+ {
+ 'type': 'insert',
+ 'data': [{ 'type': 'paragraph' }, 'd', 'e',
'f', { 'type': '/paragraph' }]
+ },
+ { 'type': 'retain', 'length': 23 }
+ ],
+ 'prepareInsertion wraps unstructured content inserted between
elements in a paragraph'
+ );
+
+ deepEqual(
+ documentModel.prepareInsertion(
+ 5,
+ [{ 'type': 'paragraph' }, 'd', 'e', 'f']
+ ),
+ [
+ { 'type': 'retain', 'length': 5 },
+ {
+ 'type': 'insert',
+ 'data': [{ 'type': 'paragraph' }, 'd', 'e',
'f', { 'type': '/paragraph' }]
+ },
+ { 'type': 'retain', 'length': 23 }
+ ],
+ 'prepareInsertion completes opening elements in inserted
content'
+ );
} );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs