2021-08-25 08:31:34 +00:00
|
|
|
QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget' );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-25 08:31:34 +00:00
|
|
|
QUnit.test( 'interprets param with no attributes', ( assert ) => {
|
2021-08-25 09:29:23 +00:00
|
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( {} );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-25 15:08:34 +00:00
|
|
|
assert.notOk( widget.checkbox.isDisabled() );
|
|
|
|
assert.notOk( widget.checkbox.isSelected() );
|
2021-08-25 09:29:23 +00:00
|
|
|
assert.strictEqual( widget.checkbox.getTitle(), null );
|
2021-08-25 08:31:34 +00:00
|
|
|
} );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-25 08:31:34 +00:00
|
|
|
QUnit.test( 'interprets required param', ( assert ) => {
|
2021-08-25 09:29:23 +00:00
|
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( { required: true } );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-25 15:08:34 +00:00
|
|
|
assert.ok( widget.checkbox.isDisabled() );
|
|
|
|
assert.ok( widget.checkbox.isSelected() );
|
2021-08-25 09:29:23 +00:00
|
|
|
assert.strictEqual(
|
|
|
|
widget.checkbox.getTitle(),
|
|
|
|
'visualeditor-dialog-transclusion-required-parameter'
|
|
|
|
);
|
2021-08-25 08:31:34 +00:00
|
|
|
} );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-25 08:31:34 +00:00
|
|
|
QUnit.test( 'interprets selected param', ( assert ) => {
|
2021-08-25 09:29:23 +00:00
|
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( { selected: true } );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-25 15:08:34 +00:00
|
|
|
assert.notOk( widget.checkbox.isDisabled() );
|
|
|
|
assert.ok( widget.checkbox.isSelected() );
|
2021-08-25 09:29:23 +00:00
|
|
|
assert.strictEqual( widget.checkbox.getTitle(), null );
|
2021-08-25 08:31:34 +00:00
|
|
|
} );
|