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.

buddy_list: Localize overrides for buddy_list.

Steve Howell976374ed0430
diff --git a/frontend_tests/node_tests/buddy_list.js b/frontend_tests/node_tests/buddy_list.js
index f7d0d48ffd6..4dd1b517479 100644
--- a/frontend_tests/node_tests/buddy_list.js
+++ b/frontend_tests/node_tests/buddy_list.js
@@ -11,13 +11,8 @@ const $ = require("../zjsunit/zjquery");
mock_cjs("jquery", $);
-mock_esm("../../static/js/padded_widget", {
- update_padding: () => {},
-});
-
-mock_esm("../../static/js/message_viewport", {
- height: () => 550,
-});
+const padded_widget = mock_esm("../../static/js/padded_widget");
+const message_viewport = mock_esm("../../static/js/message_viewport");
const people = zrequire("people");
const {BuddyList} = zrequire("buddy_list");
@@ -76,6 +71,9 @@ run_test("basics", (override) => {
return "html-stub";
});
+ override(message_viewport, "height", () => 550);
+ override(padded_widget, "update_padding", () => {});
+
let appended;
$("#user_presences").append = (html) => {
assert.equal(html, "html-stub");
@@ -114,6 +112,7 @@ run_test("big_list", (override) => {
elem.scrollHeight += 100;
chunks_inserted += 1;
});
+ override(message_viewport, "height", () => 550);
// We will have more than enough users, but still
// only do 6 chunks of data.
@@ -213,6 +212,8 @@ run_test("scrolling", (override) => {
const buddy_list = new BuddyList();
init_simulated_scrolling();
+ override(message_viewport, "height", () => 550);
+
buddy_list.populate({
keys: [],
});