mediawiki-extensions-Visual.../modules/ve-mw/tests/dm/models/ve.dm.MWTransclusionContentModel.test.js
libraryupgrader 702677220d build: Updating eslint-config-wikimedia to 0.28.0
The following rules are failing and were disabled:
* modules/ve-mw/tests:
  * implicit-arrow-linebreak

Change-Id: If857233c0de24c8cf619dbb1347ebb375f3ab1ba
2024-06-04 03:40:00 +00:00

28 lines
616 B
JavaScript

{
QUnit.module( 've.dm.MWTransclusionContentModel' );
/**
* @return {ve.dm.MWTransclusionModel} but it's a mock
*/
const createTransclusionModel = function () {
return {
nextUniquePartId: () => 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 );
} )
);
}