diff --git a/web/e2e/smart-actions.spec.ts b/web/e2e/smart-actions.spec.ts index d983f26..3f0a5bc 100644 --- a/web/e2e/smart-actions.spec.ts +++ b/web/e2e/smart-actions.spec.ts @@ -130,4 +130,70 @@ test.describe("Smart Actions", () => { ); expect(realErrors).toHaveLength(0); }); + + test("prompts page loads with template list", async ({ page }) => { + await page.goto("/prompts"); + await page.waitForLoadState("domcontentloaded"); + await expect(page.locator("body")).toBeVisible(); + }); + + test("knowledge gaps page loads", async ({ page }) => { + await page.route("**/api/workspaces/ws-1/knowledge-gaps", (route) => + route.fulfill({ + status: 200, + contentType: "application/json", + body: JSON.stringify({ gaps: [], topicMap: {} }), + }) + ); + await page.goto("/workspaces/ws-1/gaps"); + await page.waitForLoadState("domcontentloaded"); + await expect(page.locator("body")).toBeVisible(); + }); + + test("search page loads without JS errors", async ({ page }) => { + const errors: string[] = []; + page.on("pageerror", (err) => errors.push(err.message)); + + await page.goto("/search"); + await page.waitForLoadState("domcontentloaded"); + await expect(page.locator("body")).toBeVisible(); + + const realErrors = errors.filter( + (e) => + !e.includes("fetch") && + !e.includes("Failed") && + !e.includes("Unexpected") && + !e.includes("hydration") + ); + expect(realErrors).toHaveLength(0); + }); + + test("workspaces page loads", async ({ page }) => { + await page.goto("/workspaces"); + await page.waitForLoadState("domcontentloaded"); + await expect(page.locator("body")).toBeVisible(); + }); + + test("reviews page loads", async ({ page }) => { + await page.goto("/reviews"); + await page.waitForLoadState("domcontentloaded"); + await expect(page.locator("body")).toBeVisible(); + }); + + test("history API mock returns items", async ({ page }) => { + await page.route("**/api/note-prompts/history**", (route) => + route.fulfill({ + status: 200, + contentType: "application/json", + body: JSON.stringify({ + items: [{ id: "h1", noteId: "n1", workspaceId: "ws1", toolName: "summarize", state: "applied", createdAt: "2026-01-01T00:00:00Z" }], + total: 1, + }), + }) + ); + const response = await page.request.get("/api/note-prompts/history?workspaceId=ws1"); + expect(response.status()).toBe(200); + const data = await response.json(); + expect(data.items).toHaveLength(1); + }); });