mediawiki-extensions-Visual.../tests/ve2/ce/ve.ce.Document.test.js
Trevor Parscal 6d0a24bec6 Greatly simplified selection and node tree comparison tests
By first summarizing a node tree or node selection and then using the normal deepEqual function we are able to take advantage of native QUnit functionality to make diagnosing a problem easier under failing conditions and reduce the verbosity of the output under passing conditions.

Change-Id: I4af5d69596cf5459aa32f61ee6d5b8355233c3df
2012-05-15 00:25:27 -07:00

16 lines
404 B
JavaScript

module( 've.ce.Document' );
/* Tests */
test( 'selectNodes', function() {
var doc = new ve.ce.Document( new ve.dm.Document( ve.dm.example.data ) ),
cases = ve.example.getSelectNodesCases( doc );
for ( var i = 0; i < cases.length; i++ ) {
deepEqual(
ve.example.getNodeSelectionSummary( cases[i].actual ),
ve.example.getNodeSelectionSummary( cases[i].expected ),
cases[i].msg
);
}
} );