mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 21:43:21 +00:00
web-e2e-tests: Update references to "private message" and "PM".
Updates any use of "private message" and "PM" in the `web/e2e-tests` directory to instead use "direct messages" or "DM".
This commit is contained in:
committed by
Tim Abbott
parent
4d3d9bcefa
commit
7c47616ffa
@@ -32,7 +32,7 @@ async function test_send_messages(page: Page): Promise<void> {
|
|||||||
|
|
||||||
await common.send_multiple_messages(page, [
|
await common.send_multiple_messages(page, [
|
||||||
{stream: "Verona", topic: "Reply test", content: "Compose stream reply test"},
|
{stream: "Verona", topic: "Reply test", content: "Compose stream reply test"},
|
||||||
{recipient: "cordelia@zulip.com", content: "Compose private message reply test"},
|
{recipient: "cordelia@zulip.com", content: "Compose direct message reply test"},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
assert.equal((await page.$$("#zhome .message_row")).length, initial_msgs_count + 2);
|
assert.equal((await page.$$("#zhome .message_row")).length, initial_msgs_count + 2);
|
||||||
@@ -74,9 +74,7 @@ async function test_reply_by_click_prepopulates_stream_topic_names(page: Page):
|
|||||||
async function test_reply_by_click_prepopulates_private_message_recipient(
|
async function test_reply_by_click_prepopulates_private_message_recipient(
|
||||||
page: Page,
|
page: Page,
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
const private_message = await page.$(
|
const private_message = await page.$(get_message_selector("Compose direct message reply test"));
|
||||||
get_message_selector("Compose private message reply test"),
|
|
||||||
);
|
|
||||||
assert.ok(private_message !== null);
|
assert.ok(private_message !== null);
|
||||||
await private_message.click();
|
await private_message.click();
|
||||||
await page.waitForSelector("#private_message_recipient", {visible: true});
|
await page.waitForSelector("#private_message_recipient", {visible: true});
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ async function create_stream_message_draft(page: Page): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function create_private_message_draft(page: Page): Promise<void> {
|
async function create_private_message_draft(page: Page): Promise<void> {
|
||||||
console.log("Creating private message draft");
|
console.log("Creating direct message draft");
|
||||||
await page.keyboard.press("KeyX");
|
await page.keyboard.press("KeyX");
|
||||||
await page.waitForSelector("#private_message_recipient", {visible: true});
|
await page.waitForSelector("#private_message_recipient", {visible: true});
|
||||||
await common.fill_form(page, "form#send_message_form", {content: "Test private message."});
|
await common.fill_form(page, "form#send_message_form", {content: "Test direct message."});
|
||||||
await common.pm_recipient.set(page, "cordelia@zulip.com");
|
await common.pm_recipient.set(page, "cordelia@zulip.com");
|
||||||
await common.pm_recipient.set(page, "hamlet@zulip.com");
|
await common.pm_recipient.set(page, "hamlet@zulip.com");
|
||||||
await page.click("#compose_close");
|
await page.click("#compose_close");
|
||||||
@@ -92,7 +92,7 @@ async function test_previously_created_drafts_rendered(page: Page): Promise<void
|
|||||||
page,
|
page,
|
||||||
".draft-row:nth-last-child(2) .rendered_markdown.restore-draft",
|
".draft-row:nth-last-child(2) .rendered_markdown.restore-draft",
|
||||||
),
|
),
|
||||||
"Test private message.",
|
"Test direct message.",
|
||||||
);
|
);
|
||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
await common.get_text_from_selector(
|
await common.get_text_from_selector(
|
||||||
@@ -166,12 +166,12 @@ async function test_edited_draft_message(page: Page): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function test_restore_private_message_draft_via_draft_overlay(page: Page): Promise<void> {
|
async function test_restore_private_message_draft_via_draft_overlay(page: Page): Promise<void> {
|
||||||
console.log("Restoring private message draft.");
|
console.log("Restoring direct message draft.");
|
||||||
await page.click(".message_row.private-message .restore-draft");
|
await page.click(".message_row.private-message .restore-draft");
|
||||||
await wait_for_drafts_to_disappear(page);
|
await wait_for_drafts_to_disappear(page);
|
||||||
await page.waitForSelector("#compose-direct-recipient", {visible: true});
|
await page.waitForSelector("#compose-direct-recipient", {visible: true});
|
||||||
await common.check_compose_state(page, {
|
await common.check_compose_state(page, {
|
||||||
content: "Test private message.",
|
content: "Test direct message.",
|
||||||
});
|
});
|
||||||
const cordelia_internal_email = await common.get_internal_email_from_name(page, "cordelia");
|
const cordelia_internal_email = await common.get_internal_email_from_name(page, "cordelia");
|
||||||
const hamlet_internal_email = await common.get_internal_email_from_name(page, "hamlet");
|
const hamlet_internal_email = await common.get_internal_email_from_name(page, "hamlet");
|
||||||
@@ -179,7 +179,7 @@ async function test_restore_private_message_draft_via_draft_overlay(page: Page):
|
|||||||
assert.strictEqual(
|
assert.strictEqual(
|
||||||
await common.get_text_from_selector(page, "title"),
|
await common.get_text_from_selector(page, "title"),
|
||||||
"Cordelia, Lear's daughter, King Hamlet - Zulip Dev - Zulip",
|
"Cordelia, Lear's daughter, King Hamlet - Zulip Dev - Zulip",
|
||||||
"Didn't narrow to the private messages with cordelia and hamlet",
|
"Didn't narrow to the direct messages with cordelia and hamlet",
|
||||||
);
|
);
|
||||||
await page.click("#compose_close");
|
await page.click("#compose_close");
|
||||||
}
|
}
|
||||||
@@ -203,12 +203,12 @@ async function test_save_draft_by_reloading(page: Page): Promise<void> {
|
|||||||
await page.keyboard.press("KeyX");
|
await page.keyboard.press("KeyX");
|
||||||
await page.waitForSelector("#compose-direct-recipient", {visible: true});
|
await page.waitForSelector("#compose-direct-recipient", {visible: true});
|
||||||
await common.fill_form(page, "form#send_message_form", {
|
await common.fill_form(page, "form#send_message_form", {
|
||||||
content: "Test private message draft.",
|
content: "Test direct message draft.",
|
||||||
});
|
});
|
||||||
await common.pm_recipient.set(page, "cordelia@zulip.com");
|
await common.pm_recipient.set(page, "cordelia@zulip.com");
|
||||||
await page.reload();
|
await page.reload();
|
||||||
|
|
||||||
// Reloading into a private messages narrow opens compose box.
|
// Reloading into a direct messages narrow opens compose box.
|
||||||
await page.waitForSelector("#compose-textarea", {visible: true});
|
await page.waitForSelector("#compose-textarea", {visible: true});
|
||||||
await page.click("#compose_close");
|
await page.click("#compose_close");
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ async function test_save_draft_by_reloading(page: Page): Promise<void> {
|
|||||||
page,
|
page,
|
||||||
".draft-row:nth-last-child(2) .rendered_markdown.restore-draft",
|
".draft-row:nth-last-child(2) .rendered_markdown.restore-draft",
|
||||||
),
|
),
|
||||||
"Test private message draft.",
|
"Test direct message draft.",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const pm_recipient = {
|
|||||||
|
|
||||||
// We use [style*="display: block"] here to distinguish
|
// We use [style*="display: block"] here to distinguish
|
||||||
// the visible typeahead menu from the invisible ones
|
// the visible typeahead menu from the invisible ones
|
||||||
// meant for something else; e.g., the private message
|
// meant for something else; e.g., the direct message
|
||||||
// input typeahead is different from the topic input
|
// input typeahead is different from the topic input
|
||||||
// typeahead but both can be present in the DOM.
|
// typeahead but both can be present in the DOM.
|
||||||
const entry = await page.waitForSelector('.typeahead[style*="display: block"] .active a', {
|
const entry = await page.waitForSelector('.typeahead[style*="display: block"] .active a', {
|
||||||
@@ -488,8 +488,9 @@ export async function get_rendered_messages(
|
|||||||
topic_label === null ? "" : (await get_element_text(topic_label)).trim();
|
topic_label === null ? "" : (await get_element_text(topic_label)).trim();
|
||||||
let key = stream_name;
|
let key = stream_name;
|
||||||
if (topic_name !== "") {
|
if (topic_name !== "") {
|
||||||
// If topic_name is '' then this is PMs, so only
|
// If topic_name is '', then this is direct messages, so only
|
||||||
// append > topic_name if we are not in PMs or Group PMs.
|
// append > topic_name if we are not in 1:1 or group direct
|
||||||
|
// messages.
|
||||||
key = `${stream_name} > ${topic_name}`;
|
key = `${stream_name} > ${topic_name}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ async function navigate_to_subscriptions(page: Page): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function navigate_to_private_messages(page: Page): Promise<void> {
|
async function navigate_to_private_messages(page: Page): Promise<void> {
|
||||||
console.log("Navigate to private messages");
|
console.log("Navigate to direct messages");
|
||||||
|
|
||||||
const all_private_messages_icon = "#show_all_private_messages";
|
const all_private_messages_icon = "#show_all_private_messages";
|
||||||
await page.waitForSelector(all_private_messages_icon, {visible: true});
|
await page.waitForSelector(all_private_messages_icon, {visible: true});
|
||||||
|
|||||||
@@ -420,7 +420,7 @@ async function test_default_language_setting(page: Page): Promise<void> {
|
|||||||
|
|
||||||
async function test_notifications_section(page: Page): Promise<void> {
|
async function test_notifications_section(page: Page): Promise<void> {
|
||||||
await page.click('[data-section="notifications"]');
|
await page.click('[data-section="notifications"]');
|
||||||
// At the beginning, "PMs, mentions, and alerts"(checkbox name=enable_sounds) audio will be on
|
// At the beginning, "DMs, mentions, and alerts"(checkbox name=enable_sounds) audio will be on
|
||||||
// and "Streams"(checkbox name=enable_stream_audible_notifications) audio will be off by default.
|
// and "Streams"(checkbox name=enable_stream_audible_notifications) audio will be off by default.
|
||||||
|
|
||||||
const notification_sound_enabled =
|
const notification_sound_enabled =
|
||||||
|
|||||||
Reference in New Issue
Block a user