Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
message_flags: Add coverage to setTimeout call from send_read.
YashRE4253473decc7d2
diff --git a/frontend_tests/node_tests/message_flags.js b/frontend_tests/node_tests/message_flags.jsindex df7b075f5d7..3e8f8d515e0 100644--- a/frontend_tests/node_tests/message_flags.js+++ b/frontend_tests/node_tests/message_flags.js@@ -144,6 +144,23 @@ run_test("read", (override) => {success: channel_post_opts.success,});+ // Messages still not acked yet+ const events = {};+ const stub_delay = 100;+ function set_timeout(f, delay) {+ assert.equal(delay, stub_delay);+ events.f = f;+ events.timer_set = true;+ return;+ }+ set_global("setTimeout", set_timeout);+ // Mock successful flagging of ids+ success_response_data = {+ messages: [3, 4, 5, 6, 7],+ };+ channel_post_opts.success(success_response_data);+ assert(events.timer_set);+// Mark them non locallocal_msg_1.locally_echoed = false;local_msg_2.locally_echoed = false;