mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-12-04 03:58:41 +00:00
cf9258b0c5
Bug: T277639 Change-Id: Ifa84dda88a8a167fc8ed2cef17254c1b722ade2d
47 lines
968 B
JavaScript
47 lines
968 B
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.msg = () => {};
|
|
},
|
|
afterEach() {
|
|
mw.msg = null;
|
|
mw.template = null;
|
|
mw.html = null;
|
|
}
|
|
} );
|
|
|
|
QUnit.test( '#render', ( assert ) => {
|
|
const boundActions = {
|
|
saveSettings() {},
|
|
hideSettings() {}
|
|
},
|
|
expected = {
|
|
appendTo() {},
|
|
show() {},
|
|
hide() {},
|
|
toggleHelp() {},
|
|
setEnabled() {}
|
|
},
|
|
result = createSettingsDialogRenderer()( 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.
|