2012-07-19 00:11:26 +00:00
|
|
|
/**
|
|
|
|
* VisualEditor Node 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-06-20 01:36:34 +00:00
|
|
|
module( 've.Node' );
|
2012-02-07 00:12:31 +00:00
|
|
|
|
2012-06-20 01:36:34 +00:00
|
|
|
/* Stubs */
|
|
|
|
|
|
|
|
ve.NodeStub = function() {
|
|
|
|
// Inheritance
|
|
|
|
ve.Node.call( this, 'stub' );
|
|
|
|
};
|
|
|
|
|
|
|
|
ve.extendClass( ve.NodeStub, ve.Node );
|
|
|
|
|
|
|
|
/* Tests */
|
|
|
|
|
2012-07-10 19:46:08 +00:00
|
|
|
test( 'getType', 1, function( assert ) {
|
2012-06-20 01:36:34 +00:00
|
|
|
var node = new ve.NodeStub();
|
2012-07-10 19:46:08 +00:00
|
|
|
assert.strictEqual( node.getType(), 'stub' );
|
2012-06-20 01:36:34 +00:00
|
|
|
} );
|
|
|
|
|
2012-07-10 19:46:08 +00:00
|
|
|
test( 'getParent', 1, function( assert ) {
|
2012-06-20 01:36:34 +00:00
|
|
|
var node = new ve.NodeStub();
|
2012-07-10 19:46:08 +00:00
|
|
|
assert.strictEqual( node.getParent(), null );
|
2012-06-20 01:36:34 +00:00
|
|
|
} );
|
|
|
|
|
2012-07-10 19:46:08 +00:00
|
|
|
test( 'getRoot', 1, function( assert ) {
|
2012-06-20 01:36:34 +00:00
|
|
|
var node = new ve.NodeStub();
|
2012-07-10 19:46:08 +00:00
|
|
|
assert.strictEqual( node.getRoot(), node );
|
2012-06-20 01:36:34 +00:00
|
|
|
} );
|