mediawiki-extensions-Visual.../modules/ve-mw/tests/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.test.js
Thiemo Kreuz 4f9426d61a Rename …ParameterCheckboxLayout now that it's an actual Widget
This is a direct follow-up for Idc5e048.

Bug: T285323
Change-Id: Ia03d594386a9a59a4819bf78c7d2edcd465dfd52
2021-08-20 09:56:40 +02:00

28 lines
1.1 KiB
JavaScript

( function () {
QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget', ve.test.utils.mwEnvironment );
QUnit.test( 'interprets param with no attributes', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( {} );
assert.strictEqual( layout.checkbox.isDisabled(), false );
assert.strictEqual( layout.checkbox.isSelected(), false );
assert.strictEqual( layout.checkbox.getTitle(), null );
} );
QUnit.test( 'interprets required param', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { required: true } );
assert.strictEqual( layout.checkbox.isDisabled(), true );
assert.strictEqual( layout.checkbox.isSelected(), true );
assert.notStrictEqual( layout.checkbox.getTitle(), null );
} );
QUnit.test( 'interprets selected param', ( assert ) => {
const layout = new ve.ui.MWTransclusionOutlineParameterWidget( { selected: true } );
assert.strictEqual( layout.checkbox.isDisabled(), false );
assert.strictEqual( layout.checkbox.isSelected(), true );
assert.strictEqual( layout.checkbox.getTitle(), null );
} );
}() );