Debian Codegraph @

extensions/VisualEditor/modules/ve-mw/tests/dm/models/ve.dm.MWTransclusionContentModel.test.js

raw symbols SCIP
1 {
2 QUnit.module( 've.dm.MWTransclusionContentModel' );
3
4 /**
5 * @return {ve.dm.MWTransclusionModel} but it's a mock
6 */
7 const createTransclusionModel = function () {
8 return {
9 nextUniquePartId: () => 0
10 };
11 };
12
13 [
14 [ undefined, false ],
15 [ null, false ],
16 [ '', false ],
17 [ ' ', true ],
18 [ '0', true ],
19 [ '\nfoo', true ]
20 ].forEach( ( [ wikitext, expected ] ) => QUnit.test( 'containsValuableData: ' + wikitext, ( assert ) => {
21 const model = new ve.dm.MWTransclusionContentModel( createTransclusionModel(), wikitext );
22
23 assert.strictEqual( model.containsValuableData(), expected );
24 } )
25 );
26
27 }