2026-04-06 08:25:42 -07:00
|
|
|
import { expect, type Page } from "@playwright/test";
|
|
|
|
|
|
|
|
|
|
type SettingsSection =
|
|
|
|
|
| "profile"
|
|
|
|
|
| "notifications"
|
2026-07-31 09:41:09 -04:00
|
|
|
| "voice"
|
2026-05-07 10:20:31 -07:00
|
|
|
| "agents"
|
2026-06-02 10:28:20 -04:00
|
|
|
| "channel-templates"
|
|
|
|
|
| "compute"
|
2026-04-06 08:25:42 -07:00
|
|
|
| "appearance"
|
2026-05-07 10:20:31 -07:00
|
|
|
| "shortcuts"
|
2026-07-25 03:30:33 +01:00
|
|
|
| "hosted-communities"
|
2026-04-06 08:25:42 -07:00
|
|
|
| "tokens"
|
2026-07-14 12:11:02 -06:00
|
|
|
| "community-members"
|
2026-05-07 10:20:31 -07:00
|
|
|
| "mobile"
|
2026-07-19 20:01:38 +01:00
|
|
|
| "updates";
|
2026-04-06 08:25:42 -07:00
|
|
|
|
|
|
|
|
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);
|
2026-06-08 15:23:11 +01:00
|
|
|
await page.getByTestId("profile-popover-settings").click();
|
2026-04-06 08:25:42 -07:00
|
|
|
await expect(page.getByTestId("settings-view")).toBeVisible();
|
|
|
|
|
|
2026-06-08 15:23:11 +01:00
|
|
|
if (section) {
|
2026-04-06 08:25:42 -07:00
|
|
|
await page.getByTestId(`settings-nav-${section}`).click();
|
|
|
|
|
}
|
|
|
|
|
}
|