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-04-30 20:42:32 +00:00
|
|
|
test( 'rebuildNodes', 88, function() {
|
|
|
|
var doc = new ve.dm.Document( ve.dm.example.data ),
|
|
|
|
documentNode = doc.getDocumentNode();
|
|
|
|
doc.rebuildNodes( documentNode, 1, 1, 5, 30 );
|
|
|
|
// Test count: ( ( 4 tests x 16 branch nodes ) + ( 3 tests x 8 leaf nodes ) ) = 88
|
|
|
|
ve.dm.example.nodeTreeEqual( documentNode, ve.dm.example.tree );
|
2012-04-27 21:59:52 +00:00
|
|
|
} );
|