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-07-10 19:46:08 +00:00
|
|
|
test( 'canBeSplit', 1, function( assert ) {
|
2012-05-22 00:39:03 +00:00
|
|
|
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
|
2012-07-10 19:46:08 +00:00
|
|
|
assert.equal( node.canBeSplit(), false );
|
2012-05-22 00:39:03 +00:00
|
|
|
} );
|
|
|
|
|
2012-07-10 19:46:08 +00:00
|
|
|
test( 'canHaveChildren', 1, function( assert ) {
|
2012-05-05 00:50:54 +00:00
|
|
|
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
|
2012-07-10 19:46:08 +00:00
|
|
|
assert.equal( node.canHaveChildren(), false );
|
2012-05-05 00:50:54 +00:00
|
|
|
} );
|
|
|
|
|
2012-07-10 19:46:08 +00:00
|
|
|
test( 'canHaveGrandchildren', 1, function( assert ) {
|
2012-05-05 00:50:54 +00:00
|
|
|
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
|
2012-07-10 19:46:08 +00:00
|
|
|
assert.equal( node.canHaveGrandchildren(), false );
|
2012-05-05 00:50:54 +00:00
|
|
|
} );
|