mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-04 03:58:41 +00:00
82d54945e4
Update copy and remove unnecessary reference preview preference in favor of using the default preference. It seems there is no stable method to link to the subsections on the preference page for gadgets. So in all cases does the link just point to the gadgets pref page. These changes should only be visible when reference previews are no longer marked as a beta feature. Bug: T265709 Change-Id: I7b8ab91331092ada04b230315373548673b9272c
49 lines
1 KiB
JavaScript
49 lines
1 KiB
JavaScript
import createSettingsDialogRenderer from '../../../src/ui/settingsDialogRenderer';
|
|
|
|
QUnit.module( 'ext.popups/settingsDialogRenderer', {
|
|
beforeEach() {
|
|
function render() {
|
|
return $( '<div>' );
|
|
}
|
|
function getTemplate() {
|
|
return { render };
|
|
}
|
|
|
|
mw.html = { escape: ( str ) => str };
|
|
mw.template = { get: getTemplate };
|
|
mw.config = { get() {} };
|
|
mw.msg = () => {};
|
|
},
|
|
afterEach() {
|
|
mw.msg = null;
|
|
mw.config = null;
|
|
mw.template = null;
|
|
mw.html = null;
|
|
}
|
|
} );
|
|
|
|
QUnit.test( '#render', ( assert ) => {
|
|
const boundActions = {
|
|
saveSettings() {},
|
|
hideSettings() {}
|
|
},
|
|
expected = {
|
|
appendTo() {},
|
|
show() {},
|
|
hide() {},
|
|
toggleHelp() {},
|
|
setEnabled() {}
|
|
},
|
|
result = createSettingsDialogRenderer( mw.config )( boundActions );
|
|
|
|
// Specifically NOT a deep equal. Only structure.
|
|
assert.propEqual(
|
|
result,
|
|
expected,
|
|
'Interface exposed has the expected methods'
|
|
);
|
|
} );
|
|
|
|
// FIXME: Add Qunit integration tests about the rendering and the behavior of
|
|
// the settings dialog.
|