learning_ai_notes/web/e2e/settings.spec.ts
2026-03-29 10:50:57 -07:00

32 lines
1017 B
TypeScript

import { test, expect } from "@playwright/test";
test.describe("Settings Page", () => {
test("settings page responds with 200", async ({ request }) => {
const res = await request.get("/settings");
expect(res.status()).toBe(200);
});
test("shows product configuration section", async ({ page }) => {
await page.goto("/settings");
await expect(
page.getByText(/product|configuration|notelett|backend/i).first()
).toBeVisible({ timeout: 10_000 });
});
test("all pages load without console 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")
);
expect(realErrors).toHaveLength(0);
});
});