mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 19:09:29 +00:00
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
|
( function () {
|
||
|
QUnit.module( 've.ui.MWTemplateOutlineParameterCheckboxLayout', ve.test.utils.mwEnvironment );
|
||
|
|
||
|
QUnit.test( 'interprets param with no attributes', ( assert ) => {
|
||
|
const layout = new ve.ui.MWTemplateOutlineParameterCheckboxLayout( {} );
|
||
|
|
||
|
assert.strictEqual( layout.fieldWidget.disabled, false );
|
||
|
assert.strictEqual( layout.fieldWidget.selected, false );
|
||
|
assert.strictEqual( layout.fieldWidget.title, null );
|
||
|
} );
|
||
|
|
||
|
QUnit.test( 'interprets required param', ( assert ) => {
|
||
|
const layout = new ve.ui.MWTemplateOutlineParameterCheckboxLayout( { required: true } );
|
||
|
|
||
|
assert.strictEqual( layout.fieldWidget.disabled, true );
|
||
|
assert.strictEqual( layout.fieldWidget.selected, true );
|
||
|
assert.notStrictEqual( layout.fieldWidget.title, null );
|
||
|
} );
|
||
|
|
||
|
QUnit.test( 'interprets included param', ( assert ) => {
|
||
|
const layout = new ve.ui.MWTemplateOutlineParameterCheckboxLayout( { selected: true } );
|
||
|
|
||
|
assert.strictEqual( layout.fieldWidget.disabled, false );
|
||
|
assert.strictEqual( layout.fieldWidget.selected, true );
|
||
|
assert.strictEqual( layout.fieldWidget.title, null );
|
||
|
} );
|
||
|
}() );
|