2021-06-18 09:48:33 +00:00
|
|
|
( function () {
|
2021-08-16 12:56:27 +00:00
|
|
|
QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget', ve.test.utils.mwEnvironment );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
|
|
|
QUnit.test( 'interprets param with no attributes', ( assert ) => {
|
2021-08-16 12:56:27 +00:00
|
|
|
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( {} );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-10 14:42:21 +00:00
|
|
|
assert.strictEqual( layout.checkbox.isDisabled(), false );
|
|
|
|
assert.strictEqual( layout.checkbox.isSelected(), false );
|
|
|
|
assert.strictEqual( layout.checkbox.getTitle(), null );
|
2021-06-18 09:48:33 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
QUnit.test( 'interprets required param', ( assert ) => {
|
2021-08-16 12:56:27 +00:00
|
|
|
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { required: true } );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-10 14:42:21 +00:00
|
|
|
assert.strictEqual( layout.checkbox.isDisabled(), true );
|
|
|
|
assert.strictEqual( layout.checkbox.isSelected(), true );
|
|
|
|
assert.notStrictEqual( layout.checkbox.getTitle(), null );
|
2021-06-18 09:48:33 +00:00
|
|
|
} );
|
|
|
|
|
2021-08-10 14:42:21 +00:00
|
|
|
QUnit.test( 'interprets selected param', ( assert ) => {
|
2021-08-16 12:56:27 +00:00
|
|
|
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { selected: true } );
|
2021-06-18 09:48:33 +00:00
|
|
|
|
2021-08-10 14:42:21 +00:00
|
|
|
assert.strictEqual( layout.checkbox.isDisabled(), false );
|
|
|
|
assert.strictEqual( layout.checkbox.isSelected(), true );
|
|
|
|
assert.strictEqual( layout.checkbox.getTitle(), null );
|
2021-06-18 09:48:33 +00:00
|
|
|
} );
|
|
|
|
}() );
|