mediawiki-extensions-Visual.../modules/ve/test/ce/ve.ce.LeafNode.test.js
Ed Sanders d22c7f7773 Correct name of can(Node)HaveGrandchildren functions
Bug: 43893
Change-Id: I9fd2a1fd6e3ee0a7bdfc357b5d4e4e0fd3efa0a5
2013-03-13 23:25:33 +00:00

39 lines
1 KiB
JavaScript

/*!
* VisualEditor ContentEditable LeafNode tests.
*
* @copyright 2011-2013 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
QUnit.module( 've.ce.LeafNode' );
/* Stubs */
ve.ce.LeafNodeStub = function VeCeLeafNodeStub( model ) {
// Parent constructor
ve.ce.LeafNode.call( this, model );
};
ve.inheritClass( ve.ce.LeafNodeStub, ve.ce.LeafNode );
ve.ce.LeafNodeStub.static.name = 'leaf-stub';
ve.ce.nodeFactory.register( ve.ce.LeafNodeStub );
/* Tests */
QUnit.test( 'canBeSplit', 1, function ( assert ) {
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
assert.equal( node.canBeSplit(), false );
} );
QUnit.test( 'canHaveChildren', 1, function ( assert ) {
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
assert.equal( node.canHaveChildren(), false );
} );
QUnit.test( 'canHaveChildrenNotContent', 1, function ( assert ) {
var node = new ve.ce.LeafNodeStub( new ve.dm.LeafNodeStub() );
assert.equal( node.canHaveChildrenNotContent(), false );
} );