diff --git a/tools/test-js-with-node b/tools/test-js-with-node index ce2ea53709..c7aa160828 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -188,7 +188,6 @@ EXEMPT_FILES = make_set( "web/src/realm_icon.ts", "web/src/realm_logo.ts", "web/src/realm_playground.ts", - "web/src/realm_user_settings_defaults.ts", "web/src/recent_view_ui.ts", "web/src/reload.ts", "web/src/reload_setup.js", diff --git a/web/tests/dispatch.test.js b/web/tests/dispatch.test.js index 68538edb35..e364755cf3 100644 --- a/web/tests/dispatch.test.js +++ b/web/tests/dispatch.test.js @@ -8,7 +8,7 @@ const {make_stub} = require("./lib/stub"); const {run_test, noop} = require("./lib/test"); const blueslip = require("./lib/zblueslip"); 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 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"); mock_esm("../src/giphy"); 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 {initialize_user_settings} = zrequire("user_settings"); @@ -104,6 +107,8 @@ const realm = {}; set_realm(realm); const current_user = {}; set_current_user(current_user); +const realm_user_settings_defaults = {}; +initialize_realm_user_settings_defaults({realm_user_settings_defaults}); const user_settings = {}; initialize_user_settings({user_settings}); diff --git a/web/tests/lib/index.js b/web/tests/lib/index.js index 29cb2a9c0d..94896a22f3 100644 --- a/web/tests/lib/index.js +++ b/web/tests/lib/index.js @@ -129,8 +129,6 @@ test.set_verbose(files.length === 1); require("../../src/billing/page_params"); namespace.mock_esm("../../src/page_params", zpage_params); require("../../src/page_params"); - namespace.mock_esm("../../src/realm_user_settings_defaults", zpage_params); - require("../../src/realm_user_settings_defaults"); try { await run_one_module(file); diff --git a/web/tests/lib/zpage_params.js b/web/tests/lib/zpage_params.js index c76c1dd7b4..dc027b0de5 100644 --- a/web/tests/lib/zpage_params.js +++ b/web/tests/lib/zpage_params.js @@ -1,7 +1,6 @@ "use strict"; exports.page_params = {}; -exports.realm_user_settings_defaults = {}; exports.reset = () => { for (const field in exports.page_params) { @@ -9,9 +8,4 @@ exports.reset = () => { 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]; - } - } };