Files
multica/e2e/navigation.spec.ts
DimaS 2f24057bc2 feat(issues): add date filter (#4129)
Co-authored-by: “646826” <“646826@gmail.com”>
2026-06-16 08:38:53 +08:00

44 lines
1.7 KiB
TypeScript

import { test, expect } from "@playwright/test";
import { loginAsDefault, waitForPageText } from "./helpers";
const ROUTE_CHANGE_TIMEOUT = 30000;
test.describe("Navigation", () => {
test.beforeEach(async ({ page }) => {
await loginAsDefault(page);
await page.waitForLoadState("networkidle");
});
test("sidebar navigation works", async ({ page }) => {
await page.getByRole("link", { name: "Inbox" }).click();
await expect(page).toHaveURL(/\/inbox/, { timeout: ROUTE_CHANGE_TIMEOUT });
await waitForPageText(page, "Inbox");
await page.getByRole("link", { name: "Agents" }).click();
await expect(page).toHaveURL(/\/agents/, { timeout: ROUTE_CHANGE_TIMEOUT });
await waitForPageText(page, "Agents");
await page.getByRole("link", { name: "Issues", exact: true }).click();
await expect(page).toHaveURL(/\/issues/, { timeout: ROUTE_CHANGE_TIMEOUT });
await waitForPageText(page, "Issues");
});
test("settings page loads via sidebar", async ({ page }) => {
await page.getByRole("link", { name: "Settings", exact: true }).click();
await expect(page).toHaveURL(/\/settings/, { timeout: ROUTE_CHANGE_TIMEOUT });
await waitForPageText(page, "Settings");
await expect(page.getByRole("tab", { name: "General" })).toBeVisible();
await expect(page.getByRole("tab", { name: "Members" })).toBeVisible();
});
test("agents page shows agent list", async ({ page }) => {
await page.getByRole("link", { name: "Agents" }).click();
await expect(page).toHaveURL(/\/agents/, { timeout: ROUTE_CHANGE_TIMEOUT });
await waitForPageText(page, "Agents");
// Should show "Agents" heading
await expect(page.locator("text=Agents").first()).toBeVisible();
});
});