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.

tests: Use typed helpers in buddy_data.test.cjs.

Tim Abbott8d639da93f58
diff --git a/web/tests/buddy_data.test.cjs b/web/tests/buddy_data.test.cjs
index 809b8e0c878..3c96932fc2d 100644
--- a/web/tests/buddy_data.test.cjs
+++ b/web/tests/buddy_data.test.cjs
@@ -5,6 +5,7 @@ const assert = require("node:assert/strict");
const _ = require("lodash");
const {make_realm} = require("./lib/example_realm.cjs");
+const {make_bot, make_user} = require("./lib/example_user.cjs");
const {make_message_list} = require("./lib/message_list.cjs");
const {mock_esm, zrequire} = require("./lib/namespace.cjs");
const {noop, run_test} = require("./lib/test.cjs");
@@ -45,64 +46,61 @@ initialize_user_settings({user_settings});
// activity.test.cjs, but we should feel free to add direct tests
// here.
-const selma = {
+const selma = make_user({
user_id: 1000,
full_name: "Human Selma",
-};
+});
-const me = {
+const me = make_user({
user_id: 1001,
full_name: "Human Myself",
-};
+});
-const alice = {
+const alice = make_user({
user_id: 1002,
full_name: "Alice Smith",
-};
+});
-const fred = {
+const fred = make_user({
user_id: 1003,
full_name: "Fred Flintstone",
-};
+});
-const jill = {
+const jill = make_user({
user_id: 1004,
full_name: "Jill Hill",
-};
+});
-const mark = {
+const mark = make_user({
user_id: 1005,
full_name: "Marky Mark",
-};
+});
-const old_user = {
+const old_user = make_user({
user_id: 9999,
full_name: "Old User",
-};
+});
-const bot = {
+const bot = make_bot({
user_id: 55555,
full_name: "Red Herring Bot",
- is_bot: true,
- bot_owner_id: null,
-};
+});
-const bot_with_owner = {
+const bot_with_owner = make_bot({
user_id: 55556,
full_name: "Blue Herring Bot",
- is_bot: true,
bot_owner_id: 1001,
bot_owner_full_name: "Human Myself",
-};
+});
function add_canned_users() {
people.add_active_user(alice, "server_events");