mediawiki-extensions-Visual.../modules/ve-mw/tests/ui/widgets/ve.ui.MWTransclusionOutlineParameterWidget.test.js
Thiemo Kreuz a0e613d8fc Remove not needed boilerplate from QUnit tests
These tests obviously don't need this extra environment.
They run just fine (and faster) without.

Bug: T289560
Change-Id: Ib186a07cd556f741e0440ffa54ae6aaaf626adcd
2021-08-25 12:01:14 +00:00

26 lines
1 KiB
JavaScript

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 );
} );