mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-17 19:31:51 +00:00
988cda65dd
Introduces new widgets forming the backbone of the experimental template dialog sidebar. FIXME: `text-overflow: ellipsis` is not working yet, the container styles need adjustment. Bug: T274543 Change-Id: Ie81b84be288553343017c4aaf8691c4e266995f5
28 lines
1.1 KiB
JavaScript
28 lines
1.1 KiB
JavaScript
( function () {
|
|
QUnit.module( 've.ui.MWTemplateOutlineParameterCheckboxWidget', ve.test.utils.mwEnvironment );
|
|
|
|
QUnit.test( 'interprets param with no attributes', ( assert ) => {
|
|
const widget = new ve.ui.MWTemplateOutlineParameterCheckboxWidget( {} );
|
|
|
|
assert.strictEqual( widget.fieldWidget.disabled, false );
|
|
assert.strictEqual( widget.fieldWidget.selected, false );
|
|
assert.strictEqual( widget.fieldWidget.title, null );
|
|
} );
|
|
|
|
QUnit.test( 'interprets required param', ( assert ) => {
|
|
const widget = new ve.ui.MWTemplateOutlineParameterCheckboxWidget( { required: true } );
|
|
|
|
assert.strictEqual( widget.fieldWidget.disabled, true );
|
|
assert.strictEqual( widget.fieldWidget.selected, true );
|
|
assert.notStrictEqual( widget.fieldWidget.title, null );
|
|
} );
|
|
|
|
QUnit.test( 'interprets included param', ( assert ) => {
|
|
const widget = new ve.ui.MWTemplateOutlineParameterCheckboxWidget( { selected: true } );
|
|
|
|
assert.strictEqual( widget.fieldWidget.disabled, false );
|
|
assert.strictEqual( widget.fieldWidget.selected, true );
|
|
assert.strictEqual( widget.fieldWidget.title, null );
|
|
} );
|
|
}() );
|