mediawiki-extensions-Visual.../tests/ve2/ve.Node.test.js
Trevor Parscal 3d6391419d Added more nodes and removed canHave[Grandc|C]hildren methods
Replacing them with static members on each node type

Change-Id: I455debf880bef4e280eea072364f5f57308ec2b1
2012-04-20 16:34:47 -07:00

28 lines
532 B
JavaScript

module( 've.Node' );
/* Stubs */
ve.NodeStub = function() {
// Inheritance
ve.Node.call( this, 'stub' );
};
ve.extendClass( ve.NodeStub, ve.Node );
/* Tests */
test( 'prototype.getType', 1, function() {
var node = new ve.NodeStub();
strictEqual( node.getType(), 'stub' );
} );
test( 'prototype.getParent', 1, function() {
var node = new ve.dm.NodeStub();
strictEqual( node.getParent(), null );
} );
test( 'prototype.getRoot', 1, function() {
var node = new ve.dm.NodeStub();
strictEqual( node.getRoot(), node );
} );