message_flags: Verify early return when starring local echo.

This commit is contained in:
YashRE42 2021-03-20 08:41:03 +00:00 committed by Tim Abbott
parent e0cedb15fc
commit f461139d26
1 changed files with 23 additions and 0 deletions

View File

@ -65,6 +65,29 @@ run_test("starred", (override) => {
starred: false, starred: false,
}); });
}); });
run_test("starring local echo", () => {
// verify early return for locally echoed message
const locally_echoed_message = {
id: 51,
starred: false,
locally_echoed: true,
};
message_flags.toggle_starred_and_update_server(locally_echoed_message);
// ui.update_starred_view not called
// channel post request not made
// starred flag unchanged
assert.deepEqual(locally_echoed_message, {
id: 51,
locally_echoed: true,
starred: false,
});
});
run_test("read", (override) => { run_test("read", (override) => {
// Way to capture posted info in every request // Way to capture posted info in every request
let channel_post_opts; let channel_post_opts;