mirror of
https://github.com/block/buzz.git
synced 2026-11-09 10:51:42 +00:00
Signed-off-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Wes <wesbillman@users.noreply.github.com> Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
35 lines
901 B
TypeScript
35 lines
901 B
TypeScript
import { expect, type Page } from "@playwright/test";
|
|
|
|
type SettingsSection =
|
|
| "profile"
|
|
| "notifications"
|
|
| "agents"
|
|
| "channel-templates"
|
|
| "compute"
|
|
| "appearance"
|
|
| "shortcuts"
|
|
| "tokens"
|
|
| "relay-members"
|
|
| "mobile"
|
|
| "updates"
|
|
| "doctor";
|
|
|
|
export async function openProfileMenu(page: Page) {
|
|
await page.getByTestId("open-settings").click();
|
|
await expect(page.getByTestId("profile-popover")).toBeVisible();
|
|
}
|
|
|
|
export async function openSettings(page: Page, section?: SettingsSection) {
|
|
await openProfileMenu(page);
|
|
if (section === "profile") {
|
|
await page.getByTestId("profile-popover-profile").click();
|
|
} else {
|
|
await page.getByTestId("profile-popover-settings").click();
|
|
}
|
|
await expect(page.getByTestId("settings-view")).toBeVisible();
|
|
|
|
if (section && section !== "profile") {
|
|
await page.getByTestId(`settings-nav-${section}`).click();
|
|
}
|
|
}
|