2022-03-15 18:24:43 +01:00
|
|
|
"use strict";
|
|
|
|
|
2024-10-09 00:25:41 +02:00
|
|
|
const assert = require("node:assert/strict");
|
2022-03-15 18:24:43 +01:00
|
|
|
|
2024-11-13 07:05:32 +01:00
|
|
|
const {mock_esm, zrequire} = require("./lib/namespace.cjs");
|
|
|
|
const {run_test} = require("./lib/test.cjs");
|
|
|
|
const blueslip = require("./lib/zblueslip.cjs");
|
2022-03-15 18:24:43 +01:00
|
|
|
|
2023-02-22 23:04:10 +01:00
|
|
|
const unread = mock_esm("../src/unread");
|
2022-03-15 18:24:43 +01:00
|
|
|
|
2024-06-12 12:04:08 +02:00
|
|
|
mock_esm("../src/settings_data", {
|
|
|
|
user_can_access_all_other_users: () => true,
|
|
|
|
});
|
2023-02-22 23:04:10 +01:00
|
|
|
mock_esm("../src/user_status", {
|
2022-03-15 18:24:43 +01:00
|
|
|
get_status_emoji: () => ({
|
2024-01-05 06:46:26 +01:00
|
|
|
emoji_code: "20",
|
2022-03-15 18:24:43 +01:00
|
|
|
}),
|
|
|
|
});
|
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
const {Filter} = zrequire("filter");
|
2022-03-16 13:53:34 +01:00
|
|
|
const narrow_state = zrequire("narrow_state");
|
2022-03-15 18:24:43 +01:00
|
|
|
const people = zrequire("people");
|
|
|
|
const pm_conversations = zrequire("pm_conversations");
|
|
|
|
const pm_list_data = zrequire("pm_list_data");
|
2024-02-13 03:44:04 +01:00
|
|
|
const message_lists = zrequire("message_lists");
|
2024-10-09 22:44:13 +02:00
|
|
|
const {set_realm} = zrequire("state_data");
|
2024-10-09 08:44:21 +02:00
|
|
|
const {initialize_user_settings} = zrequire("user_settings");
|
|
|
|
|
2024-10-09 22:44:13 +02:00
|
|
|
set_realm({});
|
2024-10-09 08:44:21 +02:00
|
|
|
initialize_user_settings({user_settings: {}});
|
2022-03-15 18:24:43 +01:00
|
|
|
|
|
|
|
const alice = {
|
|
|
|
email: "alice@zulip.com",
|
|
|
|
user_id: 101,
|
|
|
|
full_name: "Alice",
|
|
|
|
};
|
|
|
|
const bob = {
|
|
|
|
email: "bob@zulip.com",
|
|
|
|
user_id: 102,
|
|
|
|
full_name: "Bob",
|
|
|
|
};
|
|
|
|
const me = {
|
|
|
|
email: "me@zulip.com",
|
|
|
|
user_id: 103,
|
|
|
|
full_name: "Me Myself",
|
|
|
|
};
|
2022-03-27 16:21:49 +02:00
|
|
|
const zoe = {
|
|
|
|
email: "zoe@zulip.com",
|
|
|
|
user_id: 104,
|
|
|
|
full_name: "Zoe",
|
|
|
|
};
|
|
|
|
const cardelio = {
|
|
|
|
email: "cardelio@zulip.com",
|
|
|
|
user_id: 105,
|
|
|
|
full_name: "Cardelio",
|
|
|
|
};
|
2023-02-10 20:03:06 +01:00
|
|
|
const iago = {
|
|
|
|
email: "iago@zulip.com",
|
|
|
|
user_id: 106,
|
|
|
|
full_name: "Iago",
|
|
|
|
};
|
2022-03-15 18:24:43 +01:00
|
|
|
const bot_test = {
|
|
|
|
email: "outgoingwebhook@zulip.com",
|
|
|
|
user_id: 314,
|
|
|
|
full_name: "Outgoing webhook",
|
|
|
|
is_admin: false,
|
|
|
|
is_bot: true,
|
|
|
|
};
|
|
|
|
people.add_active_user(alice);
|
|
|
|
people.add_active_user(bob);
|
|
|
|
people.add_active_user(me);
|
2022-03-27 16:21:49 +02:00
|
|
|
people.add_active_user(zoe);
|
|
|
|
people.add_active_user(cardelio);
|
2023-02-10 20:03:06 +01:00
|
|
|
people.add_active_user(iago);
|
2022-03-15 18:24:43 +01:00
|
|
|
people.add_active_user(bot_test);
|
|
|
|
people.initialize_current_user(me.user_id);
|
|
|
|
|
|
|
|
function test(label, f) {
|
2022-07-10 01:06:33 +02:00
|
|
|
run_test(label, (helpers) => {
|
2024-02-13 03:44:04 +01:00
|
|
|
message_lists.set_current(undefined);
|
2022-03-15 18:24:43 +01:00
|
|
|
pm_conversations.clear_for_testing();
|
2022-07-10 01:06:33 +02:00
|
|
|
f(helpers);
|
2022-03-15 18:24:43 +01:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
function set_pm_with_filter(emails) {
|
2023-04-11 21:04:33 +02:00
|
|
|
const active_filter = new Filter([{operator: "dm", operand: emails}]);
|
2024-02-13 03:44:04 +01:00
|
|
|
message_lists.set_current({
|
|
|
|
data: {
|
|
|
|
filter: active_filter,
|
|
|
|
},
|
|
|
|
});
|
2023-02-10 19:29:43 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
function check_list_info(list, length, more_unread, recipients_array) {
|
|
|
|
assert.deepEqual(list.conversations_to_be_shown.length, length);
|
|
|
|
assert.deepEqual(list.more_conversations_unread_count, more_unread);
|
|
|
|
assert.deepEqual(
|
|
|
|
list.conversations_to_be_shown.map((conversation) => conversation.recipients),
|
|
|
|
recipients_array,
|
|
|
|
);
|
2022-03-27 16:21:49 +02:00
|
|
|
}
|
|
|
|
|
2022-04-07 00:29:10 +02:00
|
|
|
test("get_conversations", ({override}) => {
|
2022-03-15 19:06:27 +01:00
|
|
|
pm_conversations.recent.insert([alice.user_id, bob.user_id], 1);
|
|
|
|
pm_conversations.recent.insert([me.user_id], 2);
|
2022-10-22 07:15:44 +02:00
|
|
|
let num_unread_for_user_ids_string = 1;
|
|
|
|
override(unread, "num_unread_for_user_ids_string", () => num_unread_for_user_ids_string);
|
2022-03-15 18:24:43 +01:00
|
|
|
|
2022-03-16 13:53:34 +01:00
|
|
|
assert.equal(narrow_state.filter(), undefined);
|
2022-03-15 18:24:43 +01:00
|
|
|
|
|
|
|
const expected_data = [
|
|
|
|
{
|
2023-04-11 14:43:49 +02:00
|
|
|
is_bot: false,
|
2022-03-15 18:24:43 +01:00
|
|
|
is_active: false,
|
|
|
|
is_group: false,
|
|
|
|
is_zero: false,
|
|
|
|
recipients: "Me Myself",
|
|
|
|
unread: 1,
|
2023-04-11 21:04:33 +02:00
|
|
|
url: "#narrow/dm/103-Me-Myself",
|
2022-03-15 18:24:43 +01:00
|
|
|
user_circle_class: "user_circle_empty",
|
|
|
|
user_ids_string: "103",
|
|
|
|
status_emoji_info: {
|
2024-01-05 06:46:26 +01:00
|
|
|
emoji_code: "20",
|
2022-03-15 18:24:43 +01:00
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
recipients: "Alice, Bob",
|
|
|
|
user_ids_string: "101,102",
|
|
|
|
unread: 1,
|
|
|
|
is_zero: false,
|
|
|
|
is_active: false,
|
2023-04-11 21:04:33 +02:00
|
|
|
url: "#narrow/dm/101,102-group",
|
2022-03-15 18:24:43 +01:00
|
|
|
user_circle_class: undefined,
|
|
|
|
is_group: true,
|
2023-04-11 14:43:49 +02:00
|
|
|
is_bot: false,
|
2022-03-15 18:24:43 +01:00
|
|
|
status_emoji_info: undefined,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2022-04-07 00:29:10 +02:00
|
|
|
let pm_data = pm_list_data.get_conversations();
|
2022-03-15 18:24:43 +01:00
|
|
|
assert.deepEqual(pm_data, expected_data);
|
|
|
|
|
2022-10-22 07:15:44 +02:00
|
|
|
num_unread_for_user_ids_string = 0;
|
2022-03-15 18:24:43 +01:00
|
|
|
|
2022-04-07 00:29:10 +02:00
|
|
|
pm_data = pm_list_data.get_conversations();
|
2022-03-15 18:24:43 +01:00
|
|
|
expected_data[0].unread = 0;
|
|
|
|
expected_data[0].is_zero = true;
|
|
|
|
expected_data[1].unread = 0;
|
|
|
|
expected_data[1].is_zero = true;
|
|
|
|
assert.deepEqual(pm_data, expected_data);
|
|
|
|
|
2022-04-07 00:29:10 +02:00
|
|
|
pm_data = pm_list_data.get_conversations();
|
2022-03-15 18:24:43 +01:00
|
|
|
assert.deepEqual(pm_data, expected_data);
|
2024-03-05 23:25:05 +01:00
|
|
|
|
|
|
|
expected_data.unshift({
|
|
|
|
recipients: "Iago",
|
|
|
|
user_ids_string: "106",
|
|
|
|
unread: 0,
|
|
|
|
is_zero: true,
|
|
|
|
is_active: true,
|
|
|
|
url: "#narrow/dm/106-Iago",
|
|
|
|
status_emoji_info: {emoji_code: "20"},
|
|
|
|
user_circle_class: "user_circle_empty",
|
|
|
|
is_group: false,
|
|
|
|
is_bot: false,
|
|
|
|
});
|
|
|
|
set_pm_with_filter("iago@zulip.com");
|
|
|
|
pm_data = pm_list_data.get_conversations();
|
|
|
|
assert.deepEqual(pm_data, expected_data);
|
2024-06-06 10:35:51 +02:00
|
|
|
|
|
|
|
pm_data = pm_list_data.get_conversations("Ia");
|
|
|
|
assert.deepEqual(
|
|
|
|
pm_data,
|
|
|
|
expected_data.filter((item) => item.recipients === "Iago"),
|
|
|
|
);
|
|
|
|
|
|
|
|
// filter should work with email
|
|
|
|
pm_data = pm_list_data.get_conversations("me@zulip");
|
|
|
|
assert.deepEqual(
|
|
|
|
pm_data,
|
|
|
|
expected_data.filter((item) => item.recipients === "Me Myself"),
|
|
|
|
);
|
2022-03-15 18:24:43 +01:00
|
|
|
});
|
|
|
|
|
2022-04-07 00:29:10 +02:00
|
|
|
test("get_conversations bot", ({override}) => {
|
2022-03-15 19:06:27 +01:00
|
|
|
pm_conversations.recent.insert([alice.user_id, bob.user_id], 1);
|
|
|
|
pm_conversations.recent.insert([bot_test.user_id], 2);
|
2022-03-15 18:24:43 +01:00
|
|
|
|
2022-10-22 07:15:44 +02:00
|
|
|
override(unread, "num_unread_for_user_ids_string", () => 1);
|
2022-03-15 18:24:43 +01:00
|
|
|
|
2022-03-16 13:53:34 +01:00
|
|
|
assert.equal(narrow_state.filter(), undefined);
|
2022-03-15 18:24:43 +01:00
|
|
|
|
|
|
|
const expected_data = [
|
|
|
|
{
|
|
|
|
recipients: "Outgoing webhook",
|
|
|
|
user_ids_string: "314",
|
|
|
|
unread: 1,
|
|
|
|
is_zero: false,
|
|
|
|
is_active: false,
|
2023-04-11 21:04:33 +02:00
|
|
|
url: "#narrow/dm/314-Outgoing-webhook",
|
2022-03-15 18:24:43 +01:00
|
|
|
status_emoji_info: undefined,
|
2023-04-11 14:43:49 +02:00
|
|
|
user_circle_class: "user_circle_empty",
|
2022-03-15 18:24:43 +01:00
|
|
|
is_group: false,
|
2023-04-11 14:43:49 +02:00
|
|
|
is_bot: true,
|
2022-03-15 18:24:43 +01:00
|
|
|
},
|
|
|
|
{
|
|
|
|
recipients: "Alice, Bob",
|
|
|
|
user_ids_string: "101,102",
|
|
|
|
unread: 1,
|
|
|
|
is_zero: false,
|
|
|
|
is_active: false,
|
2023-04-11 21:04:33 +02:00
|
|
|
url: "#narrow/dm/101,102-group",
|
2022-03-15 18:24:43 +01:00
|
|
|
user_circle_class: undefined,
|
|
|
|
status_emoji_info: undefined,
|
|
|
|
is_group: true,
|
2023-04-11 14:43:49 +02:00
|
|
|
is_bot: false,
|
2022-03-15 18:24:43 +01:00
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2022-04-07 00:29:10 +02:00
|
|
|
const pm_data = pm_list_data.get_conversations();
|
2022-03-15 18:24:43 +01:00
|
|
|
assert.deepEqual(pm_data, expected_data);
|
|
|
|
});
|
|
|
|
|
2022-03-16 13:53:34 +01:00
|
|
|
test("get_active_user_ids_string", () => {
|
2022-03-15 18:24:43 +01:00
|
|
|
assert.equal(pm_list_data.get_active_user_ids_string(), undefined);
|
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
const stream_filter = new Filter([{operator: "stream", operand: "test"}]);
|
2024-02-13 03:44:04 +01:00
|
|
|
message_lists.set_current({
|
|
|
|
data: {
|
|
|
|
filter: stream_filter,
|
|
|
|
},
|
|
|
|
});
|
2022-03-15 18:24:43 +01:00
|
|
|
assert.equal(pm_list_data.get_active_user_ids_string(), undefined);
|
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
set_pm_with_filter("bob@zulip.com,alice@zulip.com");
|
2022-03-15 18:24:43 +01:00
|
|
|
assert.equal(pm_list_data.get_active_user_ids_string(), "101,102");
|
2024-06-26 12:28:37 +02:00
|
|
|
|
|
|
|
blueslip.expect("warn", "Unknown emails");
|
|
|
|
set_pm_with_filter("invalid@zulip.com");
|
|
|
|
assert.equal(pm_list_data.get_active_user_ids_string(), undefined);
|
|
|
|
blueslip.reset();
|
|
|
|
|
|
|
|
set_pm_with_filter("bob@zulip.com,alice@zulip.com,me@zulip.com");
|
|
|
|
assert.equal(pm_list_data.get_active_user_ids_string(), "101,102");
|
2022-03-15 18:24:43 +01:00
|
|
|
});
|
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
test("get_list_info_unread_messages", ({override}) => {
|
2022-03-27 16:21:49 +02:00
|
|
|
let list_info;
|
|
|
|
assert.equal(narrow_state.filter(), undefined);
|
|
|
|
|
|
|
|
// Initialize an empty list to start.
|
2023-02-10 19:29:43 +01:00
|
|
|
list_info = pm_list_data.get_list_info(false);
|
|
|
|
check_list_info(list_info, 0, 0, []);
|
2022-03-27 16:21:49 +02:00
|
|
|
|
|
|
|
// Mock to arrange that each user has exactly 1 unread.
|
2023-02-10 19:29:43 +01:00
|
|
|
override(unread, "num_unread_for_user_ids_string", () => 1);
|
2022-03-27 16:21:49 +02:00
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
// Initially, append 2 conversations and check for the
|
2022-03-27 16:21:49 +02:00
|
|
|
// `conversations_to_be_shown` returned in list_info.
|
2023-02-10 19:29:43 +01:00
|
|
|
pm_conversations.recent.insert([alice.user_id], 1);
|
2022-03-27 16:21:49 +02:00
|
|
|
pm_conversations.recent.insert([me.user_id], 2);
|
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
list_info = pm_list_data.get_list_info(false);
|
|
|
|
check_list_info(list_info, 2, 0, ["Me Myself", "Alice"]);
|
2022-03-27 16:21:49 +02:00
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
// Visible conversations are limited to value of
|
2022-03-27 16:21:49 +02:00
|
|
|
// `max_conversations_to_show_with_unreads`.
|
2023-02-10 19:29:43 +01:00
|
|
|
// Verify that the oldest conversations are not shown and
|
|
|
|
// their unreads are counted in more_conversations_unread_count.
|
|
|
|
pm_conversations.recent.insert([bob.user_id], 3);
|
|
|
|
pm_conversations.recent.insert([alice.user_id, bob.user_id], 4);
|
|
|
|
pm_conversations.recent.insert([zoe.user_id], 5);
|
|
|
|
pm_conversations.recent.insert([zoe.user_id, bob.user_id], 6);
|
|
|
|
pm_conversations.recent.insert([zoe.user_id, alice.user_id], 7);
|
|
|
|
pm_conversations.recent.insert([zoe.user_id, bob.user_id, alice.user_id], 8);
|
|
|
|
pm_conversations.recent.insert([cardelio.user_id, zoe.user_id], 9);
|
|
|
|
pm_conversations.recent.insert([cardelio.user_id, bob.user_id], 10);
|
2023-02-10 20:03:06 +01:00
|
|
|
pm_conversations.recent.insert([cardelio.user_id, alice.user_id], 11);
|
|
|
|
pm_conversations.recent.insert([cardelio.user_id, zoe.user_id, bob.user_id], 12);
|
|
|
|
pm_conversations.recent.insert([cardelio.user_id, zoe.user_id, alice.user_id], 13);
|
|
|
|
pm_conversations.recent.insert([cardelio.user_id, bob.user_id, alice.user_id], 14);
|
|
|
|
pm_conversations.recent.insert([cardelio.user_id, bob.user_id, alice.user_id, zoe.user_id], 15);
|
|
|
|
pm_conversations.recent.insert([cardelio.user_id], 16);
|
|
|
|
pm_conversations.recent.insert([iago.user_id], 17);
|
2023-02-10 19:29:43 +01:00
|
|
|
|
|
|
|
list_info = pm_list_data.get_list_info(false);
|
2023-02-10 20:03:06 +01:00
|
|
|
check_list_info(list_info, 15, 2, [
|
|
|
|
"Iago",
|
|
|
|
"Cardelio",
|
|
|
|
"Alice, Bob, Cardelio, Zoe",
|
|
|
|
"Alice, Bob, Cardelio",
|
|
|
|
"Alice, Cardelio, Zoe",
|
|
|
|
"Bob, Cardelio, Zoe",
|
|
|
|
"Alice, Cardelio",
|
2023-02-10 19:29:43 +01:00
|
|
|
"Bob, Cardelio",
|
|
|
|
"Cardelio, Zoe",
|
|
|
|
"Alice, Bob, Zoe",
|
|
|
|
"Alice, Zoe",
|
|
|
|
"Bob, Zoe",
|
|
|
|
"Zoe",
|
|
|
|
"Alice, Bob",
|
|
|
|
"Bob",
|
|
|
|
]);
|
|
|
|
|
2023-06-16 17:37:19 +02:00
|
|
|
// Narrowing to direct messages with Alice adds older
|
2023-02-10 19:29:43 +01:00
|
|
|
// one-on-one conversation with her to the list and one
|
|
|
|
// unread is removed from more_conversations_unread_count.
|
|
|
|
set_pm_with_filter("alice@zulip.com");
|
|
|
|
list_info = pm_list_data.get_list_info(false);
|
2023-02-10 20:03:06 +01:00
|
|
|
check_list_info(list_info, 16, 1, [
|
|
|
|
"Iago",
|
|
|
|
"Cardelio",
|
|
|
|
"Alice, Bob, Cardelio, Zoe",
|
|
|
|
"Alice, Bob, Cardelio",
|
|
|
|
"Alice, Cardelio, Zoe",
|
|
|
|
"Bob, Cardelio, Zoe",
|
|
|
|
"Alice, Cardelio",
|
2023-02-10 19:29:43 +01:00
|
|
|
"Bob, Cardelio",
|
|
|
|
"Cardelio, Zoe",
|
|
|
|
"Alice, Bob, Zoe",
|
|
|
|
"Alice, Zoe",
|
|
|
|
"Bob, Zoe",
|
|
|
|
"Zoe",
|
|
|
|
"Alice, Bob",
|
|
|
|
"Bob",
|
|
|
|
"Alice",
|
|
|
|
]);
|
|
|
|
|
|
|
|
// Zooming will show all conversations and there will
|
|
|
|
// be no unreads in more_conversations_unread_count.
|
|
|
|
list_info = pm_list_data.get_list_info(true);
|
2023-02-10 20:03:06 +01:00
|
|
|
check_list_info(list_info, 17, 0, [
|
|
|
|
"Iago",
|
|
|
|
"Cardelio",
|
|
|
|
"Alice, Bob, Cardelio, Zoe",
|
|
|
|
"Alice, Bob, Cardelio",
|
|
|
|
"Alice, Cardelio, Zoe",
|
|
|
|
"Bob, Cardelio, Zoe",
|
|
|
|
"Alice, Cardelio",
|
2023-02-10 19:29:43 +01:00
|
|
|
"Bob, Cardelio",
|
|
|
|
"Cardelio, Zoe",
|
|
|
|
"Alice, Bob, Zoe",
|
|
|
|
"Alice, Zoe",
|
|
|
|
"Bob, Zoe",
|
|
|
|
"Zoe",
|
|
|
|
"Alice, Bob",
|
|
|
|
"Bob",
|
|
|
|
"Me Myself",
|
|
|
|
"Alice",
|
|
|
|
]);
|
|
|
|
});
|
2022-03-27 16:21:49 +02:00
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
test("get_list_info_no_unread_messages", ({override}) => {
|
|
|
|
let list_info;
|
2022-10-22 07:15:44 +02:00
|
|
|
override(unread, "num_unread_for_user_ids_string", () => 0);
|
2023-02-10 19:29:43 +01:00
|
|
|
|
2022-03-27 16:21:49 +02:00
|
|
|
pm_conversations.recent.insert([alice.user_id], 1);
|
2023-02-10 19:29:43 +01:00
|
|
|
pm_conversations.recent.insert([me.user_id], 2);
|
|
|
|
pm_conversations.recent.insert([bob.user_id], 3);
|
2022-03-27 16:21:49 +02:00
|
|
|
pm_conversations.recent.insert([zoe.user_id], 4);
|
|
|
|
pm_conversations.recent.insert([cardelio.user_id], 5);
|
2023-02-10 19:29:43 +01:00
|
|
|
pm_conversations.recent.insert([zoe.user_id, cardelio.user_id], 6);
|
2022-03-27 16:21:49 +02:00
|
|
|
pm_conversations.recent.insert([alice.user_id, bob.user_id], 7);
|
2023-02-10 20:03:06 +01:00
|
|
|
pm_conversations.recent.insert([zoe.user_id, bob.user_id], 8);
|
|
|
|
pm_conversations.recent.insert([alice.user_id, cardelio.user_id], 9);
|
|
|
|
pm_conversations.recent.insert([bob.user_id, cardelio.user_id], 10);
|
2022-03-27 16:21:49 +02:00
|
|
|
|
2023-02-10 19:29:43 +01:00
|
|
|
// Visible conversations are limited to value of
|
|
|
|
// `max_conversations_to_show`.
|
|
|
|
list_info = pm_list_data.get_list_info(false);
|
2023-02-10 20:03:06 +01:00
|
|
|
check_list_info(list_info, 8, 0, [
|
|
|
|
"Bob, Cardelio",
|
|
|
|
"Alice, Cardelio",
|
|
|
|
"Bob, Zoe",
|
|
|
|
"Alice, Bob",
|
|
|
|
"Cardelio, Zoe",
|
|
|
|
"Cardelio",
|
|
|
|
"Zoe",
|
|
|
|
"Bob",
|
|
|
|
]);
|
2023-02-10 19:29:43 +01:00
|
|
|
|
2023-06-16 17:37:19 +02:00
|
|
|
// Narrowing to direct messages with Alice adds older
|
2023-02-10 19:29:43 +01:00
|
|
|
// one-on-one conversation with her to the list.
|
|
|
|
set_pm_with_filter("alice@zulip.com");
|
|
|
|
list_info = pm_list_data.get_list_info(false);
|
2023-02-10 20:03:06 +01:00
|
|
|
check_list_info(list_info, 9, 0, [
|
|
|
|
"Bob, Cardelio",
|
|
|
|
"Alice, Cardelio",
|
|
|
|
"Bob, Zoe",
|
2023-02-10 19:29:43 +01:00
|
|
|
"Alice, Bob",
|
|
|
|
"Cardelio, Zoe",
|
|
|
|
"Cardelio",
|
|
|
|
"Zoe",
|
|
|
|
"Bob",
|
|
|
|
"Alice",
|
|
|
|
]);
|
|
|
|
|
|
|
|
// Zooming will show all conversations.
|
|
|
|
list_info = pm_list_data.get_list_info(true);
|
2023-02-10 20:03:06 +01:00
|
|
|
check_list_info(list_info, 10, 0, [
|
|
|
|
"Bob, Cardelio",
|
|
|
|
"Alice, Cardelio",
|
|
|
|
"Bob, Zoe",
|
2023-02-10 19:29:43 +01:00
|
|
|
"Alice, Bob",
|
|
|
|
"Cardelio, Zoe",
|
|
|
|
"Cardelio",
|
|
|
|
"Zoe",
|
|
|
|
"Bob",
|
|
|
|
"Me Myself",
|
|
|
|
"Alice",
|
|
|
|
]);
|
2022-03-27 16:21:49 +02:00
|
|
|
});
|