mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 19:09:29 +00:00
6d0a24bec6
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
16 lines
404 B
JavaScript
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
|
|
);
|
|
}
|
|
} );
|