node tests: Avoid unnecessary people mocks.

The first mock here probably hasn't been
needed for a long time, and the second one
is easily addressed by making hamlet be
the current user.
This commit is contained in:
Steve Howell 2020-09-02 14:15:23 +00:00 committed by Steve Howell
parent 551a19c90d
commit fb96407607
1 changed files with 1 additions and 5 deletions

View File

@ -251,6 +251,7 @@ people.add_active_user(hal);
people.add_active_user(harry);
people.add_active_user(deactivated_user);
people.deactivate(deactivated_user);
people.initialize_current_user(hamlet.user_id);
const hamletcharacters = {
name: "hamletcharacters",
@ -783,12 +784,7 @@ run_test("initialize", () => {
assert.equal(appended_name, "Othello, the Moor of Venice");
let appended_names = [];
people.__Rewire__("get_by_user_id", (user_id) => {
const users = {100: hamlet, 104: lear};
return users[user_id];
});
people.__Rewire__("my_current_email", () => "hamlet@zulip.com");
compose_pm_pill.set_from_typeahead = function (item) {
appended_names.push(item.full_name);
};