mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 14:56:20 +00:00
d22c7f7773
Bug: 43893 Change-Id: I9fd2a1fd6e3ee0a7bdfc357b5d4e4e0fd3efa0a5
39 lines
1 KiB
JavaScript
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 );
|
|
} );
|