snapshot of https://github.com/zulip/zulip.git @ 48c69911c7dd4e03b20552eb3bd77ad8151c1357 (2026-09-15)
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
Some checks failed
Code scanning / CodeQL (push) Failing after 15s
Zulip production suite / Ubuntu 22.04 production build (push) Failing after 26s
Zulip production suite / Debian 12 production install with custom db name and user (push) Has been skipped
Zulip production suite / Ubuntu 22.04 production install and PostgreSQL upgrade with pgroonga (push) Has been skipped
Zulip production suite / Ubuntu 24.04 production install (push) Has been skipped
Zulip production suite / Ubuntu 26.04 production install (push) Has been skipped
Zulip production suite / Debian 13 production install (push) Has been skipped
Zulip production suite / 7.0 Version Upgrade (push) Has been skipped
Zulip production suite / 8.0 Version Upgrade (push) Has been skipped
Zulip production suite / 6.0 Version Upgrade (push) Has been skipped
Zulip production suite / 10.0 Version Upgrade (push) Has been skipped
Zulip production suite / 9.0 Version Upgrade (push) Has been skipped
Zulip production suite / 12.0 Version Upgrade (push) Has been skipped
Zulip production suite / 11.0 Version Upgrade (push) Has been skipped
GitHub Actions Security Analysis with zizmor / zizmor (push) Failing after 3s
Zulip CI / Debian 12 (Python 3.11, backend + documentation) (push) Failing after 26s
Zulip CI / Ubuntu 22.04 (Python 3.10, backend + frontend) (push) Failing after 3s
Zulip CI / Ubuntu 24.04 (Python 3.12, backend) (push) Failing after 25s
Zulip CI / Ubuntu 26.04 (Python 3.14, backend) (push) Failing after 25s
Zulip CI / Debian 13 (Python 3.13, backend) (push) Failing after 28s
Zulip production suite / Required jobs (push) Has been cancelled
Zulip CI / Required jobs (push) Has been cancelled
API Documentation Update Check / check-feature-level-updated (push) Has been cancelled
API Documentation Update Check / notify-if-api-docs-changed (push) Has been cancelled
This commit is contained in:
86
web/e2e-tests/stars.test.ts
Normal file
86
web/e2e-tests/stars.test.ts
Normal file
@@ -0,0 +1,86 @@
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
import type {Page} from "puppeteer";
|
||||
|
||||
import * as common from "./lib/common.ts";
|
||||
|
||||
const message = "test star";
|
||||
|
||||
async function stars_count(page: Page): Promise<number> {
|
||||
return (await page.$$(".message-list .zulip-icon-star-filled:not(.empty-star)")).length;
|
||||
}
|
||||
|
||||
async function toggle_test_star_message(page: Page): Promise<void> {
|
||||
const messagebox = await page.waitForSelector(
|
||||
`xpath/(//*[${common.has_class_x("message-list")}]//*[${common.has_class_x(
|
||||
"message_content",
|
||||
)} and normalize-space()="${message}"])[last()]/ancestor::*[${common.has_class_x(
|
||||
"messagebox",
|
||||
)}]`,
|
||||
{visible: true},
|
||||
);
|
||||
assert.ok(messagebox !== null);
|
||||
await messagebox.hover();
|
||||
|
||||
const star_icon = await messagebox.waitForSelector(".star", {visible: true});
|
||||
assert.ok(star_icon !== null);
|
||||
await star_icon.click();
|
||||
}
|
||||
|
||||
async function test_narrow_to_starred_messages(page: Page): Promise<void> {
|
||||
await page.click('#left-sidebar-navigation-list a[href^="#narrow/is/starred"]');
|
||||
const message_list_id = await common.get_current_msg_list_id(page, true);
|
||||
await common.check_messages_sent(page, message_list_id, [["Verona > stars", [message]]]);
|
||||
|
||||
// Go back to the combined feed view.
|
||||
await page.click("#left-sidebar-navigation-list .top_left_all_messages");
|
||||
const combined_feed_id = await common.get_current_msg_list_id(page, true);
|
||||
await page.waitForSelector(
|
||||
`.message-list[data-message-list-id='${combined_feed_id}'] .message_row`,
|
||||
{visible: true},
|
||||
);
|
||||
}
|
||||
|
||||
async function stars_test(page: Page): Promise<void> {
|
||||
await common.log_in(page);
|
||||
await page.click("#left-sidebar-navigation-list .top_left_all_messages");
|
||||
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},
|
||||
);
|
||||
// Assert that there is only one message list.
|
||||
assert.equal((await page.$$(".message-list")).length, 1);
|
||||
await common.send_message(page, "stream", {
|
||||
stream_name: "Verona",
|
||||
topic: "stars",
|
||||
content: message,
|
||||
});
|
||||
|
||||
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},
|
||||
);
|
||||
assert.strictEqual(
|
||||
await stars_count(page),
|
||||
1,
|
||||
"Failed to ensure 1 starred message after change.",
|
||||
);
|
||||
|
||||
await test_narrow_to_starred_messages(page);
|
||||
assert.strictEqual(
|
||||
await stars_count(page),
|
||||
1,
|
||||
"Message star disappeared after switching views.",
|
||||
);
|
||||
|
||||
await toggle_test_star_message(page);
|
||||
assert.strictEqual(await stars_count(page), 0, "Message was not unstarred correctly.");
|
||||
}
|
||||
|
||||
await common.run_test(stars_test);
|
||||
Reference in New Issue
Block a user