mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
Extract unread_ops.process_read_messages_event().
The new method borrows some code from the event loop and unread_ops.mark_messages_as_read, and it is now flexible about message_ids being marked as unread even when there is no corresponding message in the message store. For that scenario we still want to update our data structures, which wasn't happening before this change. (Generally, this was a non-issue up until now, but it will become a bigger issue when we start loading unread message ids from the server.)
This commit is contained in:
@@ -820,13 +820,12 @@ with_overrides(function (override) {
|
||||
with_overrides(function (override) {
|
||||
// update_message_flags__read
|
||||
var event = event_fixtures.update_message_flags__read;
|
||||
override('unread_ops.mark_messages_as_read', noop);
|
||||
|
||||
global.with_stub(function (stub) {
|
||||
override('message_store.get', stub.f);
|
||||
override('unread_ops.process_read_messages_event', stub.f);
|
||||
dispatch(event);
|
||||
var args = stub.get_args('message_id');
|
||||
assert_same(args.message_id, 999);
|
||||
var args = stub.get_args('message_ids');
|
||||
assert_same(args.message_ids, [999]);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user