mirror of https://github.com/zulip/zulip.git
tests: Unmock realm_user_settings_defaults.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
a2c4e3a220
commit
ca8d25f830
|
@ -188,7 +188,6 @@ EXEMPT_FILES = make_set(
|
||||||
"web/src/realm_icon.ts",
|
"web/src/realm_icon.ts",
|
||||||
"web/src/realm_logo.ts",
|
"web/src/realm_logo.ts",
|
||||||
"web/src/realm_playground.ts",
|
"web/src/realm_playground.ts",
|
||||||
"web/src/realm_user_settings_defaults.ts",
|
|
||||||
"web/src/recent_view_ui.ts",
|
"web/src/recent_view_ui.ts",
|
||||||
"web/src/reload.ts",
|
"web/src/reload.ts",
|
||||||
"web/src/reload_setup.js",
|
"web/src/reload_setup.js",
|
||||||
|
|
|
@ -8,7 +8,7 @@ const {make_stub} = require("./lib/stub");
|
||||||
const {run_test, noop} = require("./lib/test");
|
const {run_test, noop} = require("./lib/test");
|
||||||
const blueslip = require("./lib/zblueslip");
|
const blueslip = require("./lib/zblueslip");
|
||||||
const $ = require("./lib/zjquery");
|
const $ = require("./lib/zjquery");
|
||||||
const {page_params, realm_user_settings_defaults} = require("./lib/zpage_params");
|
const {page_params} = require("./lib/zpage_params");
|
||||||
|
|
||||||
const event_fixtures = events.fixtures;
|
const event_fixtures = events.fixtures;
|
||||||
const test_message = events.test_message;
|
const test_message = events.test_message;
|
||||||
|
@ -97,6 +97,9 @@ const user_group_edit = mock_esm("../src/user_group_edit");
|
||||||
const overlays = mock_esm("../src/overlays");
|
const overlays = mock_esm("../src/overlays");
|
||||||
mock_esm("../src/giphy");
|
mock_esm("../src/giphy");
|
||||||
const {Filter} = zrequire("filter");
|
const {Filter} = zrequire("filter");
|
||||||
|
const {initialize: initialize_realm_user_settings_defaults} = zrequire(
|
||||||
|
"realm_user_settings_defaults",
|
||||||
|
);
|
||||||
const {set_current_user, set_realm} = zrequire("state_data");
|
const {set_current_user, set_realm} = zrequire("state_data");
|
||||||
const {initialize_user_settings} = zrequire("user_settings");
|
const {initialize_user_settings} = zrequire("user_settings");
|
||||||
|
|
||||||
|
@ -104,6 +107,8 @@ const realm = {};
|
||||||
set_realm(realm);
|
set_realm(realm);
|
||||||
const current_user = {};
|
const current_user = {};
|
||||||
set_current_user(current_user);
|
set_current_user(current_user);
|
||||||
|
const realm_user_settings_defaults = {};
|
||||||
|
initialize_realm_user_settings_defaults({realm_user_settings_defaults});
|
||||||
const user_settings = {};
|
const user_settings = {};
|
||||||
initialize_user_settings({user_settings});
|
initialize_user_settings({user_settings});
|
||||||
|
|
||||||
|
|
|
@ -129,8 +129,6 @@ test.set_verbose(files.length === 1);
|
||||||
require("../../src/billing/page_params");
|
require("../../src/billing/page_params");
|
||||||
namespace.mock_esm("../../src/page_params", zpage_params);
|
namespace.mock_esm("../../src/page_params", zpage_params);
|
||||||
require("../../src/page_params");
|
require("../../src/page_params");
|
||||||
namespace.mock_esm("../../src/realm_user_settings_defaults", zpage_params);
|
|
||||||
require("../../src/realm_user_settings_defaults");
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await run_one_module(file);
|
await run_one_module(file);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
exports.page_params = {};
|
exports.page_params = {};
|
||||||
exports.realm_user_settings_defaults = {};
|
|
||||||
|
|
||||||
exports.reset = () => {
|
exports.reset = () => {
|
||||||
for (const field in exports.page_params) {
|
for (const field in exports.page_params) {
|
||||||
|
@ -9,9 +8,4 @@ exports.reset = () => {
|
||||||
delete exports.page_params[field];
|
delete exports.page_params[field];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const field in exports.realm_user_settings_defaults) {
|
|
||||||
if (Object.hasOwn(exports.realm_user_settings_defaults, field)) {
|
|
||||||
delete exports.realm_user_settings_defaults[field];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue