mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 02:51:50 +00:00
9887dbd96f
* Makes it simpler in the linear model because we don't have to use style: "item" for regular list items and style: "definition" for definition lists * Enforces correct nesting through existing node rules systems * Updates tests accordingly Change-Id: I64d80af938e325f1961226505bdc386bb35ccdda
21 lines
632 B
JavaScript
21 lines
632 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', 114, 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 21 branch nodes ) + ( 3 tests x 10 leaf nodes ) ) = 114
|
|
ve.dm.example.nodeTreeEqual( documentNode, ve.dm.example.tree );
|
|
} );
|