import { expect, test } from "@playwright/test"; test("dashboard happy path", async ({ page }) => { await page.goto("/"); // Page title is present await expect(page.getByRole("heading", { name: "Dashboard" })).toBeVisible(); // Quick-add FAB is present await expect(page.getByRole("button", { name: "Quick add" })).toBeVisible(); // Widget card titles from registered manifests should appear (exact match inside main) const main = page.getByRole("main"); await expect(main.getByText("Upcoming events", { exact: true })).toBeVisible(); await expect(main.getByText("List items", { exact: true })).toBeVisible(); await expect(main.getByText("Notes", { exact: true }).first()).toBeVisible(); await expect(main.getByText("Recent activity", { exact: true })).toBeVisible(); // No horizontal scroll on mobile viewport await page.setViewportSize({ width: 375, height: 812 }); await page.goto("/"); await expect(page.getByRole("heading", { name: "Dashboard" })).toBeVisible(); const bodyWidth = await page.evaluate(() => document.body.scrollWidth); const viewportWidth = await page.evaluate(() => window.innerWidth); expect(bodyWidth).toBeLessThanOrEqual(viewportWidth + 2); // 2px tolerance for sub-pixel rendering });