diff --git a/.gitignore b/.gitignore index 6329e49..e64f658 100644 --- a/.gitignore +++ b/.gitignore @@ -152,3 +152,8 @@ site/SPECIFICATION.md site/DESIGN.md site/ARCHITECTURE.md .claude/settings.json tmp + +# Playwright +test-results/ +playwright-report/ +playwright/.cache/ diff --git a/site/e2e/homepage.spec.ts b/site/e2e/homepage.spec.ts index 1a85af2..00d94dd 100644 --- a/site/e2e/homepage.spec.ts +++ b/site/e2e/homepage.spec.ts @@ -114,6 +114,42 @@ test.describe("Homepage", () => { expect(newState).toBe(!initialState); }); + test("preset toggle updates preview without console errors", async ({ + page, + }) => { + const errors: string[] = []; + page.on("console", (msg) => { + if (msg.type() === "error") { + errors.push(msg.text()); + } + }); + + const previewBefore = await page + .locator("[class*='font-mono']") + .first() + .innerHTML(); + + const checkbox = page + .locator("input[type='checkbox']") + .filter({ hasText: /log levels/i }) + .or(page.locator("input[type='checkbox']").first()); + await checkbox.first().click(); + + await page.waitForTimeout(500); + + const previewAfter = await page + .locator("[class*='font-mono']") + .first() + .innerHTML(); + + const criticalErrors = errors.filter( + (e) => + !e.includes("Download the React DevTools") && + !e.includes("hydration"), + ); + expect(criticalErrors).toHaveLength(0); + }); + test("live preview shows log output", async ({ page }) => { const preview = page.locator("[class*='font-mono']").first(); await expect(preview).toBeVisible(); diff --git a/site/test-results/.last-run.json b/site/test-results/.last-run.json index f740f7c..cbcc1fb 100644 --- a/site/test-results/.last-run.json +++ b/site/test-results/.last-run.json @@ -1,4 +1,4 @@ { "status": "passed", "failedTests": [] -} +} \ No newline at end of file