Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message_flags: Verify early return when starring local echo.

YashRE42f461139d26ad
diff --git a/frontend_tests/node_tests/message_flags.js b/frontend_tests/node_tests/message_flags.js
index 3e8f8d515e0..74f0bfad878 100644
--- a/frontend_tests/node_tests/message_flags.js
+++ b/frontend_tests/node_tests/message_flags.js
@@ -65,6 +65,29 @@ run_test("starred", (override) => {
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) => {
// Way to capture posted info in every request
let channel_post_opts;