mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 10:59:56 +00:00
926913cad6
Bug: T289560 Change-Id: Ia76e13582a182c8184b3e8642c5c03bf3d674a24
29 lines
1,004 B
JavaScript
29 lines
1,004 B
JavaScript
QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget' );
|
|
|
|
QUnit.test( 'interprets param with no attributes', ( assert ) => {
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( {} );
|
|
|
|
assert.notOk( widget.checkbox.isDisabled() );
|
|
assert.notOk( widget.checkbox.isSelected() );
|
|
assert.strictEqual( widget.checkbox.getTitle(), null );
|
|
} );
|
|
|
|
QUnit.test( 'interprets required param', ( assert ) => {
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( { required: true } );
|
|
|
|
assert.ok( widget.checkbox.isDisabled() );
|
|
assert.ok( widget.checkbox.isSelected() );
|
|
assert.strictEqual(
|
|
widget.checkbox.getTitle(),
|
|
'visualeditor-dialog-transclusion-required-parameter'
|
|
);
|
|
} );
|
|
|
|
QUnit.test( 'interprets selected param', ( assert ) => {
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( { selected: true } );
|
|
|
|
assert.notOk( widget.checkbox.isDisabled() );
|
|
assert.ok( widget.checkbox.isSelected() );
|
|
assert.strictEqual( widget.checkbox.getTitle(), null );
|
|
} );
|