Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,8 @@ site/SPECIFICATION.md
site/DESIGN.md
site/ARCHITECTURE.md .claude/settings.json
tmp

# Playwright
test-results/
playwright-report/
playwright/.cache/
36 changes: 36 additions & 0 deletions site/e2e/homepage.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion site/test-results/.last-run.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"status": "passed",
"failedTests": []
}
}