mediawiki-extensions-Visual.../modules/ve-mw/tests/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.test.js

26 lines
1 KiB
JavaScript
Raw Normal View History

QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget' );
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 );
} );