mediawiki-extensions-Visual.../modules/ve-mw/tests/dm/models/ve.dm.MWTransclusionContentModel.test.js
Ed Sanders e1fb20d8be Replace IIFE with block scope in ES6 code
Change-Id: I635f72a62ae44943a7705d28e92c9a0d265800b6
2021-10-14 15:11:45 +01:00

30 lines
618 B
JavaScript

{
QUnit.module( 've.dm.MWTransclusionContentModel' );
/**
* @return {ve.dm.MWTransclusionModel} but it's a mock
*/
const createTransclusionModel = function () {
return {
getUniquePartId: () => 0
};
};
[
[ undefined, false ],
[ null, false ],
[ '', false ],
[ ' ', true ],
[ '0', true ],
[ '\nfoo', true ]
].forEach( ( [ wikitext, expected ] ) =>
QUnit.test( 'containsValuableData: ' + wikitext, ( assert ) => {
const model = new ve.dm.MWTransclusionContentModel( createTransclusionModel(), wikitext );
assert.strictEqual( model.containsValuableData(), expected );
} )
);
}