overlays: Handle restoring messages in inaccessible streams.

On trying to restore a draft or a scheduled message in a
stream that is no longer accessible, compose box is opened
without selecting any stream with dropdown open.

Previously, it raised an AssertionError.
This commit is contained in:
Sahil Batra
2025-08-11 14:28:32 +05:30
committed by Tim Abbott
parent f1f317c8c3
commit 6292b03b33
2 changed files with 13 additions and 2 deletions

View File

@@ -330,6 +330,8 @@ test("respond_to_message", ({override, override_rewire, mock_template}) => {
override(realm, "realm_direct_message_permission_group", nobody.id);
override(realm, "realm_direct_message_initiator_group", everyone.id);
override_rewire(stream_data, "can_post_messages_in_stream", () => true);
// Test direct message
const person = make_user({
user_id: 22,
@@ -392,6 +394,8 @@ test("reply_with_mention", ({override, override_rewire, mock_template}) => {
override_rewire(compose_recipient, "check_posting_policy_for_compose_box", noop);
mock_template("inline_decorated_channel_name.hbs", false, noop);
override_rewire(stream_data, "can_post_messages_in_stream", () => true);
const denmark = make_stream({
color: "blue",
name: "Denmark",