mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-22 11:02:58 +00:00
3f97610e6e
Bug: T272355 Bug: T290554 Change-Id: Icebf7139ed64cdad49522f7b082d1925a9a4a21b
30 lines
627 B
JavaScript
30 lines
627 B
JavaScript
( function () {
|
|
|
|
QUnit.module( 've.dm.MWTransclusionContentModel' );
|
|
|
|
/**
|
|
* @return {ve.dm.MWTransclusionModel} but it's a mock
|
|
*/
|
|
function createTransclusionModel() {
|
|
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 );
|
|
} )
|
|
);
|
|
|
|
}() );
|