mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
node tests: Clean pm_conversations more simply.
This commit is contained in:
committed by
Steve Howell
parent
b2be16c4d0
commit
728905d4bc
@@ -18,12 +18,6 @@ class RecentPrivateMessages {
|
||||
recent_message_ids = new FoldDict(); // key is user_ids_string
|
||||
recent_private_messages = [];
|
||||
|
||||
clear_for_testing() {
|
||||
// Because we only export the singleton, we need this for tests.
|
||||
this.recent_message_ids.clear();
|
||||
this.recent_private_messages.length = 0;
|
||||
}
|
||||
|
||||
insert(user_ids, message_id) {
|
||||
if (user_ids.length === 0) {
|
||||
// The server sends [] for self-PMs.
|
||||
@@ -81,9 +75,9 @@ class RecentPrivateMessages {
|
||||
}
|
||||
}
|
||||
|
||||
export const recent = new RecentPrivateMessages();
|
||||
export let recent = new RecentPrivateMessages();
|
||||
|
||||
export function clear_for_testing() {
|
||||
recent.clear_for_testing();
|
||||
recent = new RecentPrivateMessages();
|
||||
partners.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user