- Add default_dashboard_layout jsonb to users + migration 0007 - Create _core/manifest.tsx with core.activity placeholder widget - Register core manifest alongside calendar/lists/notes - Update all three module manifests with real async server-component widget renders (upcoming events, month view, list items, notes) - Add src/lib/dashboard.ts: computeDefaultLayout greedy packer + parseDashboardLayout Zod validator - Build src/app/page.tsx: 12-col CSS Grid, static smColSpan lookup, per-widget Suspense for parallel loading, generic widget.render() dispatch — no widgetId branches - Add tests/e2e/dashboard.spec.ts; all 4 E2E specs pass Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
27 lines
1.2 KiB
TypeScript
27 lines
1.2 KiB
TypeScript
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
|
|
});
|