2012-04-19 21:17:59 +00:00
|
|
|
module( 've.dm.LeafNode' );
|
2012-04-20 00:45:58 +00:00
|
|
|
|
|
|
|
/* Stubs */
|
|
|
|
|
|
|
|
ve.dm.LeafNodeStub = function() {
|
|
|
|
// Inheritance
|
2012-05-02 20:58:50 +00:00
|
|
|
ve.dm.LeafNode.call( this, 'leaf-stub' );
|
2012-04-20 00:45:58 +00:00
|
|
|
};
|
|
|
|
|
2012-05-03 18:52:17 +00:00
|
|
|
ve.dm.LeafNodeStub.rules = {
|
2012-05-22 00:39:03 +00:00
|
|
|
'isWrapped': true,
|
|
|
|
'isContent': true,
|
|
|
|
'canContainContent': false,
|
|
|
|
'childNodeTypes': []
|
2012-05-03 18:52:17 +00:00
|
|
|
};
|
|
|
|
|
2012-05-31 23:50:16 +00:00
|
|
|
ve.dm.LeafNodeStub.converters = null;
|
|
|
|
|
2012-04-20 00:45:58 +00:00
|
|
|
ve.extendClass( ve.dm.LeafNodeStub, ve.dm.LeafNode );
|
|
|
|
|
2012-05-31 22:20:58 +00:00
|
|
|
ve.dm.nodeFactory.register( 'leaf-stub', ve.dm.LeafNodeStub );
|
2012-05-03 18:52:17 +00:00
|
|
|
|
2012-04-20 00:45:58 +00:00
|
|
|
/* Tests */
|
2012-05-05 00:50:54 +00:00
|
|
|
|
|
|
|
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 );
|
|
|
|
} );
|