mediawiki-extensions-Visual.../tests/ve2/ve.LeafNode.test.js
Trevor Parscal c9ce7dbffe Added some basic coverage for ve.*Node classes
* prototype.canHaveChildren
* prototype.canHaveGrandchildren
* prototype.getType
* prototype.getParent
* prototype.getRoot
* prototype.setRoot
* prototype.attach
* prototype.detach

Change-Id: I920f7c9504e467f4818df537608760165c28d432
2012-04-19 14:43:58 -07:00

23 lines
474 B
JavaScript

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