mediawiki-extensions-Visual.../tests/ve2/dm/ve.dm.LeafNode.test.js
Trevor Parscal 042ffb4e3b Added foundation for new converter
* Added converters to all relevant node implementations
* Added new annotation objects with their own factory

Change-Id: I9870d6d5eac45083929d74d2e58917d0939ca917
2012-05-31 16:50:16 -07:00

34 lines
695 B
JavaScript

module( 've.dm.LeafNode' );
/* Stubs */
ve.dm.LeafNodeStub = function() {
// Inheritance
ve.dm.LeafNode.call( this, 'leaf-stub' );
};
ve.dm.LeafNodeStub.rules = {
'isWrapped': true,
'isContent': true,
'canContainContent': false,
'childNodeTypes': []
};
ve.dm.LeafNodeStub.converters = null;
ve.extendClass( ve.dm.LeafNodeStub, ve.dm.LeafNode );
ve.dm.nodeFactory.register( 'leaf-stub', ve.dm.LeafNodeStub );
/* Tests */
test( 'canHaveChildren', 1, function() {
var node = new ve.dm.LeafNodeStub();
equal( node.canHaveChildren(), false );
} );
test( 'canHaveGrandchildren', 1, function() {
var node = new ve.dm.LeafNodeStub();
equal( node.canHaveGrandchildren(), false );
} );