mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-21 02:22:51 +00:00
702677220d
The following rules are failing and were disabled: * modules/ve-mw/tests: * implicit-arrow-linebreak Change-Id: If857233c0de24c8cf619dbb1347ebb375f3ab1ba
28 lines
616 B
JavaScript
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 );
|
|
} )
|
|
);
|
|
|
|
}
|