compose: Jump to conversation where message was sent.

Removes two 'narrow_to_recipient' banners which were
shown after sending a message to a different conversation.

Now, the sender is narrowed to the conversation where
message was sent.

Fixes #29186.
This commit is contained in:
Prakhar Pratyush
2024-03-06 17:42:08 +05:30
committed by Tim Abbott
parent e959a392c9
commit e4cbca698d
10 changed files with 59 additions and 77 deletions

View File

@@ -35,6 +35,7 @@ async function test_send_messages(page: Page): Promise<void> {
{recipient: "cordelia@zulip.com", content: "Compose direct message reply test"},
]);
await page.click("#left-sidebar-navigation-list .top_left_all_messages");
assert.equal((await page.$$(".message-list .message_row")).length, initial_msgs_count + 2);
}

View File

@@ -150,6 +150,7 @@ async function copy_paste_test(page: Page): Promise<void> {
{stream_name: "Verona", topic: "copy-paste-topic #3", content: "copy paste test G"},
]);
await page.click("#left-sidebar-navigation-list .top_left_all_messages");
const message_list_id = await common.get_current_msg_list_id(page, true);
await common.check_messages_sent(page, message_list_id, [
["Verona > copy-paste-topic #1", ["copy paste test A", "copy paste test B"]],

View File

@@ -306,9 +306,7 @@ async function drafts_test(page: Page): Promise<void> {
outside_view: true,
});
await create_private_message_draft(page);
// Narrow to the conversation so that the compose box will restore it,
// then close and try restoring it by opening the composebox again.
await page.click("#compose .narrow_to_compose_recipients");
// Close and try restoring it by opening the composebox again.
await page.click("#compose_close");
await test_restore_private_message_draft_by_opening_composebox(page);

View File

@@ -29,7 +29,7 @@ async function edit_stream_message(page: Page, content: string): Promise<void> {
await common.wait_for_fully_processed_message(page, content);
}
async function test_stream_message_edit(page: Page, message_list_id: number): Promise<void> {
async function test_stream_message_edit(page: Page): Promise<void> {
await common.send_message(page, "stream", {
stream_name: "Verona",
topic: "edits",
@@ -38,6 +38,7 @@ async function test_stream_message_edit(page: Page, message_list_id: number): Pr
await edit_stream_message(page, "test edited");
const message_list_id = await common.get_current_msg_list_id(page, true);
await common.check_messages_sent(page, message_list_id, [["Verona > edits", ["test edited"]]]);
}
@@ -76,7 +77,7 @@ async function test_edit_message_with_slash_me(page: Page): Promise<void> {
);
}
async function test_edit_private_message(page: Page, message_list_id: number): Promise<void> {
async function test_edit_private_message(page: Page): Promise<void> {
await common.send_message(page, "private", {
recipient: "cordelia@zulip.com",
content: "test editing pm",
@@ -87,6 +88,7 @@ async function test_edit_private_message(page: Page, message_list_id: number): P
await page.click(".message_edit_save");
await common.wait_for_fully_processed_message(page, "test edited pm");
const message_list_id = await common.get_current_msg_list_id(page, true);
await common.check_messages_sent(page, message_list_id, [
["You and Cordelia, Lear's daughter", ["test edited pm"]],
]);
@@ -96,11 +98,10 @@ async function edit_tests(page: Page): Promise<void> {
await common.log_in(page);
await page.click("#left-sidebar-navigation-list .top_left_all_messages");
await page.waitForSelector(".message-list .message_row", {visible: true});
const message_list_id = await common.get_current_msg_list_id(page, true);
await test_stream_message_edit(page, message_list_id);
await test_stream_message_edit(page);
await test_edit_message_with_slash_me(page);
await test_edit_private_message(page, message_list_id);
await test_edit_private_message(page);
}
common.run_test(edit_tests);

View File

@@ -553,6 +553,7 @@ async function message_basic_tests(page: Page): Promise<void> {
{recipient: "cordelia@zulip.com", content: "direct message e"},
]);
await page.click("#left-sidebar-navigation-list .top_left_all_messages");
await expect_home(page);
await test_navigations_from_home(page);

View File

@@ -44,7 +44,7 @@ async function test_narrow_to_starred_messages(page: Page): Promise<void> {
async function stars_test(page: Page): Promise<void> {
await common.log_in(page);
await page.click("#left-sidebar-navigation-list .top_left_all_messages");
const message_list_id = await common.get_current_msg_list_id(page, true);
let message_list_id = await common.get_current_msg_list_id(page, true);
await page.waitForSelector(
`.message-list[data-message-list-id='${message_list_id}'] .message_row`,
{visible: true},
@@ -60,6 +60,8 @@ async function stars_test(page: Page): Promise<void> {
assert.strictEqual(await stars_count(page), 0, "Unexpected already starred message(s).");
await toggle_test_star_message(page);
await page.click("#left-sidebar-navigation-list .top_left_all_messages");
message_list_id = await common.get_current_msg_list_id(page, true);
await page.waitForSelector(
`.message-list[data-message-list-id='${message_list_id}'] .zulip-icon-star-filled`,
{visible: true},