mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-16 19:09:29 +00:00
1f19d85ea8
Contains: * Full test coverage (I believe) for the filter functionality in …OutlineTemplateWidget. Also some TODOs for missing tests I believe are critical. Bug: T289560 Change-Id: I2ac5add8e189d501d3558bbd4854cb92155bcb96
29 lines
1.1 KiB
JavaScript
29 lines
1.1 KiB
JavaScript
QUnit.module( 've.ui.MWTransclusionOutlineParameterWidget' );
|
|
|
|
QUnit.test( 'interprets param with no attributes', ( assert ) => {
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( {} );
|
|
|
|
assert.strictEqual( widget.checkbox.isDisabled(), false );
|
|
assert.strictEqual( widget.checkbox.isSelected(), false );
|
|
assert.strictEqual( widget.checkbox.getTitle(), null );
|
|
} );
|
|
|
|
QUnit.test( 'interprets required param', ( assert ) => {
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( { required: true } );
|
|
|
|
assert.strictEqual( widget.checkbox.isDisabled(), true );
|
|
assert.strictEqual( widget.checkbox.isSelected(), true );
|
|
assert.strictEqual(
|
|
widget.checkbox.getTitle(),
|
|
'visualeditor-dialog-transclusion-required-parameter'
|
|
);
|
|
} );
|
|
|
|
QUnit.test( 'interprets selected param', ( assert ) => {
|
|
const widget = new ve.ui.MWTransclusionOutlineParameterWidget( { selected: true } );
|
|
|
|
assert.strictEqual( widget.checkbox.isDisabled(), false );
|
|
assert.strictEqual( widget.checkbox.isSelected(), true );
|
|
assert.strictEqual( widget.checkbox.getTitle(), null );
|
|
} );
|