mediawiki-extensions-Visual.../tests/ve2/dm/ve.dm.TextNode.test.js
Trevor Parscal 93390847bc Added getOuterLength tests for text and document nodes
Neither of these nodes have elements around them, so they must override the default behavior of ve.dm.Node

Change-Id: I19c02c210bfc04b6e2ee1a37b8890e84a236eee3
2012-04-30 13:48:20 -07:00

11 lines
249 B
JavaScript

module( 've.dm.TextNode' );
/* Tests */
test( 'getOuterLength', 2, function() {
var node1 = new ve.dm.TextNode(),
node2 = new ve.dm.TextNode( 1234 );
strictEqual( node1.getOuterLength(), 0 );
strictEqual( node2.getOuterLength(), 1234 );
} );