2012-04-27 21:59:52 +00:00
|
|
|
module( 've.dm.Document' );
|
|
|
|
|
|
|
|
/* Tests */
|
|
|
|
|
2012-04-30 20:48:20 +00:00
|
|
|
test( 'getOuterLength', 1, function() {
|
|
|
|
var fragment = new ve.dm.DocumentFragment( ve.dm.example.data );
|
|
|
|
strictEqual(
|
|
|
|
fragment.getDocumentNode().getOuterLength(),
|
|
|
|
ve.dm.example.data.length,
|
|
|
|
'document does not have elements around it'
|
|
|
|
);
|
|
|
|
} );
|
|
|
|
|
2012-05-04 18:56:32 +00:00
|
|
|
test( 'rebuildNodes', 114, function() {
|
2012-04-30 20:42:32 +00:00
|
|
|
var doc = new ve.dm.Document( ve.dm.example.data ),
|
|
|
|
documentNode = doc.getDocumentNode();
|
|
|
|
doc.rebuildNodes( documentNode, 1, 1, 5, 30 );
|
2012-05-04 18:56:32 +00:00
|
|
|
// Test count: ( ( 4 tests x 21 branch nodes ) + ( 3 tests x 10 leaf nodes ) ) = 114
|
2012-04-30 20:42:32 +00:00
|
|
|
ve.dm.example.nodeTreeEqual( documentNode, ve.dm.example.tree );
|
2012-04-27 21:59:52 +00:00
|
|
|
} );
|