Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

node tests: Use with_overrides for function.

Steve Howell41b1b0bb3245
diff --git a/frontend_tests/node_tests/presence.js b/frontend_tests/node_tests/presence.js
index 3e4b6854298..408a40e8541 100644
--- a/frontend_tests/node_tests/presence.js
+++ b/frontend_tests/node_tests/presence.js
@@ -2,7 +2,7 @@
const {strict: assert} = require("assert");
-const {mock_esm, with_field_rewire, zrequire} = require("../zjsunit/namespace");
+const {mock_esm, with_overrides, zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");
const blueslip = require("../zjsunit/zblueslip");
const {user_settings} = require("../zjsunit/zpage_params");
@@ -100,14 +100,10 @@ test("unknown user", ({override}) => {
// If the server is suspected to be offline or reloading,
// then we suppress errors. The use case here is that we
// haven't gotten info for a brand new user yet.
- with_field_rewire(
- watchdog,
- "suspects_user_is_offline",
- () => true,
- () => {
- presence.set_info(presences, now);
- },
- );
+ with_overrides(({override_rewire}) => {
+ override_rewire(watchdog, "suspects_user_is_offline", () => true);
+ presence.set_info(presences, now);
+ });
override(reload_state, "is_in_progress", () => true);
presence.set_info(presences, now);