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 09:29:23 +00:00
|
|
|
assert.strictEqual( widget.checkbox.isDisabled(), false );
|
|
|
|
assert.strictEqual( widget.checkbox.isSelected(), false );
|
|
|
|
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 09:29:23 +00:00
|
|
|
assert.strictEqual( widget.checkbox.isDisabled(), true );
|
|
|
|
assert.strictEqual( widget.checkbox.isSelected(), true );
|
|
|
|
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 09:29:23 +00:00
|
|
|
assert.strictEqual( widget.checkbox.isDisabled(), false );
|
|
|
|
assert.strictEqual( widget.checkbox.isSelected(), true );
|
|
|
|
assert.strictEqual( widget.checkbox.getTitle(), null );
|
2021-08-25 08:31:34 +00:00
|
|
|
} );
|