mediawiki-extensions-Visual.../modules/ve/test/ce/ve.ce.LeafNode.test.js
Trevor Parscal efafed3231 Remove ve.{inheritClass,mixinClass} and use OO instead
Change-Id: I8df9226a358a76b661eab6e967ff0d63d361f691
2013-10-18 18:58:08 +02: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 );
};
OO.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 );
} );