mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
refactor: Extract pm_conversations.recent.
This is a pretty pure code move, where we moved stuff from
message_store to pm_conversations:
insert_recent_private_message() -> recent.insert()
recent_private_messages -> recent.get()
The object message_store.recent_private_messages was not
encapsulated in a function before this change. Now it is
hidden in the scope of pm_conversations.recent.
Both of the modules touched here maintain 100% line coverage.
This commit is contained in:
@@ -60,20 +60,6 @@ people.add_in_realm(cindy);
|
||||
|
||||
global.people.initialize_current_user(me.user_id);
|
||||
|
||||
(function test_insert_recent_private_message() {
|
||||
message_store.insert_recent_private_message('1', 1001);
|
||||
message_store.insert_recent_private_message('2', 2001);
|
||||
message_store.insert_recent_private_message('1', 3001);
|
||||
|
||||
// try to backdate user1's timestamp
|
||||
message_store.insert_recent_private_message('1', 555);
|
||||
|
||||
assert.deepEqual(message_store.recent_private_messages, [
|
||||
{user_ids_string: '1', timestamp: 3001},
|
||||
{user_ids_string: '2', timestamp: 2001},
|
||||
]);
|
||||
}());
|
||||
|
||||
(function test_add_message_metadata() {
|
||||
var message = {
|
||||
sender_email: 'me@example.com',
|
||||
|
||||
Reference in New Issue
Block a user