import { test, expect } from "@playwright/test"; test.describe("Navigation", () => { test("landing page loads", async ({ page }) => { await page.goto("/"); await page.waitForLoadState("domcontentloaded"); await expect(page.locator("body")).toBeVisible(); }); test("all app pages respond with 200", async ({ request }) => { const routes = ["/dashboard", "/workspaces", "/search", "/reviews", "/settings"]; for (const route of routes) { const res = await request.get(route); expect(res.status()).toBe(200); } }); test("all pages load without JS errors", async ({ page }) => { const errors: string[] = []; page.on("pageerror", (err) => errors.push(err.message)); const routes = ["/dashboard", "/workspaces", "/search", "/reviews", "/settings"]; for (const route of routes) { await page.goto(route); await page.waitForLoadState("domcontentloaded"); } const realErrors = errors.filter( (e) => !e.includes("fetch") && !e.includes("Failed") && !e.includes("Unexpected") ); expect(realErrors).toHaveLength(0); }); });