mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 16:44:51 +00:00
93390847bc
Neither of these nodes have elements around them, so they must override the default behavior of ve.dm.Node Change-Id: I19c02c210bfc04b6e2ee1a37b8890e84a236eee3
21 lines
629 B
JavaScript
21 lines
629 B
JavaScript
module( 've.dm.Document' );
|
|
|
|
/* Tests */
|
|
|
|
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'
|
|
);
|
|
} );
|
|
|
|
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 );
|
|
} );
|