2012-07-19 00:11:26 +00:00
|
|
|
/**
|
|
|
|
* VisualEditor content editable LeafNode tests.
|
2012-07-19 21:25:16 +00:00
|
|
|
*
|
2012-07-19 00:11:26 +00:00
|
|
|
* @copyright 2011-2012 VisualEditor Team and others; see AUTHORS.txt
|
|
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
|
|
*/
|
|
|
|
|
2012-05-01 00:04:49 +00:00
|
|
|
module( 've.ce.LeafNode' );
|
|
|
|
|
|
|
|
/* Stubs */
|
|
|
|
|
|
|
|
ve.ce.LeafNodeStub = function( model ) {
|
|
|
|
// Inheritance
|
2012-05-05 00:50:54 +00:00
|
|
|
ve.ce.LeafNode.call( this, 'leaf-stub', model );
|
|
|
|
};
|
|
|
|
|
2012-05-22 00:39:03 +00:00
|
|
|
ve.ce.LeafNodeStub.rules = {
|
|
|
|
'canBeSplit': false
|
|
|
|
};
|
|
|
|
|
2012-05-01 00:04:49 +00:00
|
|
|
ve.extendClass( ve.ce.LeafNodeStub, ve.ce.LeafNode );
|
|
|
|
|
2012-05-31 22:20:58 +00:00
|
|
|
ve.ce.nodeFactory.register( 'leaf-stub', ve.ce.LeafNodeStub );
|
2012-05-02 20:58:50 +00:00
|
|
|
|
2012-05-01 00:04:49 +00:00
|
|
|
/* Tests */
|
2012-05-05 00:50:54 +00:00
|
|
|
|
2012-05-22 00:39:03 +00:00
|
|
|
test( 'canBeSplit', 1, function() {
|
|
|
|
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
|
|
|
|
equal( node.canBeSplit(), false );
|
|
|
|
} );
|
|
|
|
|
2012-05-05 00:50:54 +00:00
|
|
|
test( 'canHaveChildren', 1, function() {
|
|
|
|
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
|
|
|
|
equal( node.canHaveChildren(), false );
|
|
|
|
} );
|
|
|
|
|
|
|
|
test( 'canHaveGrandchildren', 1, function() {
|
|
|
|
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
|
|
|
|
equal( node.canHaveGrandchildren(), false );
|
|
|
|
} );
|