mirror of https://github.com/zulip/zulip.git
node tests: Add huddle_string test.
This commit is contained in:
parent
0d218a4b76
commit
8f9126cd91
|
@ -1089,5 +1089,23 @@ test_people("get_active_message_people", () => {
|
|||
assert.deepEqual(active_message_people, [steven, maria]);
|
||||
});
|
||||
|
||||
test_people("huddle_string", () => {
|
||||
assert.equal(people.huddle_string({type: "stream"}), undefined);
|
||||
|
||||
function huddle(user_ids) {
|
||||
return people.huddle_string({
|
||||
type: "private",
|
||||
display_recipient: user_ids.map((id) => ({id})),
|
||||
});
|
||||
}
|
||||
|
||||
people.add_active_user(maria);
|
||||
people.add_active_user(bob);
|
||||
|
||||
assert.equal(huddle([]), undefined);
|
||||
assert.equal(huddle([me.user_id, maria.user_id]), undefined);
|
||||
assert.equal(huddle([me.user_id, maria.user_id, bob.user_id]), "203,302");
|
||||
});
|
||||
|
||||
// reset to native Date()
|
||||
MockDate.reset();
|
||||
|
|
Loading…
Reference in New Issue