mediawiki-extensions-Visual.../tests/ve2/ve.TwigNode.test.js
Trevor Parscal fd49e8df32 Added more tests for ve.*Node and ve.dm.*Node classes
In this commit several methods (child node add/remove and parent/root modification) were also moved to ve.dm.BranchNode ve.dm.Node respectively. ve.Node and ve.BranchNode are immutable. ve.dm.Node and ve.dm.BranchNode are mutable. Other subclasses of ve.Node and ve.BranchNode should implement functionality to mimic changes made to a data model.

Change-Id: Ia9ff78764f8f50f99fc8f9f9593657c0a0bf287e
2012-04-19 16:03:59 -07:00

23 lines
465 B
JavaScript

module( 've.TwigNode' );
/* Stubs */
ve.TwigNodeStub = function() {
// Inheritance
ve.TwigNode.call( this );
};
ve.extendClass( ve.TwigNodeStub, ve.TwigNode );
/* Tests */
test( 'prototype.canHaveChildren', 1, function() {
var node = new ve.TwigNodeStub();
strictEqual( node.canHaveChildren(), true );
} );
test( 'prototype.canHaveGrandchildren', 1, function() {
var node = new ve.TwigNodeStub();
strictEqual( node.canHaveGrandchildren(), false );
} );