Phase 0 (CI/CD): fix root typecheck to cover api+worker+web; reconcile migration story into idempotent db:migrate (db:sync + db:triggers); add Gitea Actions quality/deploy/smoke workflow; rewrite README/AGENTS/DEPLOY docs; add requireWorkspaceAccess + recordActivityForEntity conventions. Phase 1 (critical fixes): calendar delete + drag/resize DnD; canvas card CRUD + bulk save + debounced autosave; logout route; graph edge workspaceId derivation; real analytics endpoints (drop Math.random); task board droppable columns + reorder persistence; Tiptap notes editor with sanitized HTML rendering; remove insecure passkey auth; domain/owner scoping (IDOR) on all by-ID routes + search/ export/realtime scoping; command palette routing + agent mention fetch; agent activity SSE handler; graph fly-to with tracked positions. Phase 2 (UX polish): login on design system; Sonner toasts app-wide; shared Loading/Empty/Error state components; working density/sidebarPos/reduce-motion settings; Inter typography; consolidated status-colors lib; unified detail routes; dashboard sort/realtime/responsive fixes; mobile responsive; a11y (radiogroups, sanitized snippets, badge labels). Phase 3 (features): daily notes timezone fix + delete + autosave + mood/energy create; active-domain store + topbar picker; graph domain picker + navigable entity links; tag assign/remove UI + server-side tag filter; real CSV export + import validation; custom fields on tasks. Phase 4 (advanced): migrate job worker into apps/worker (webhook delivery with HMAC, recurring spawn, ai_dispatch disabled); webhook queue helper + entity event enqueuing + test endpoint fix; recurring scheduledJobs pipeline; agents CRUD + permission editing + activity filters; real notifications feed; MCP polish (validation, error codes, domain scoping, dead sql leftover). Phase 5 (E2E + docs): rewrite Playwright suite for the Vite SPA (15 specs, new auth helpers, chromium-only in CI); add ephemeral-Postgres e2e CI job; rewrite docs/API.md for the real Hono API.
53 lines
2.5 KiB
TypeScript
53 lines
2.5 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { login } from './helpers/auth';
|
|
|
|
test.describe('Navigation', () => {
|
|
test.beforeEach(async ({ page }) => {
|
|
await login(page);
|
|
});
|
|
|
|
test('every primary route renders its page', async ({ page }) => {
|
|
const pages = [
|
|
{ url: '/', check: page.getByRole('heading', { name: /dashboard/i }) },
|
|
{ url: '/tasks', check: page.getByRole('heading', { name: /tasks/i }) },
|
|
{ url: '/habits', check: page.getByRole('heading', { name: /habits/i }) },
|
|
{ url: '/projects', check: page.getByRole('heading', { name: /projects/i }) },
|
|
{ url: '/notes', check: page.getByRole('button', { name: /new note/i }) },
|
|
{ url: '/calendar', check: page.getByRole('heading', { name: /calendar/i }) },
|
|
{ url: '/graph', check: page.getByPlaceholder(/find a node/i) },
|
|
{ url: '/search', check: page.getByPlaceholder(/search tasks, notes/i) },
|
|
{ url: '/analytics', check: page.getByRole('heading', { name: /analytics/i }) },
|
|
{ url: '/agents/activity', check: page.getByRole('heading', { name: /agent activity/i }) },
|
|
{ url: '/canvas', check: page.getByRole('heading', { name: /canvas/i }) },
|
|
{ url: '/daily', check: page.getByRole('button', { name: /today/i }) },
|
|
{ url: '/settings', check: page.getByRole('button', { name: 'Appearance' }) },
|
|
];
|
|
|
|
for (const { url, check } of pages) {
|
|
await page.goto(url);
|
|
await page.waitForURL(`**${url}`, { timeout: 10_000 });
|
|
await expect(check).toBeVisible({ timeout: 10_000 });
|
|
}
|
|
});
|
|
|
|
test('navigates via the sidebar links', async ({ page }) => {
|
|
// The sidebar is desktop-only; on narrow viewports it lives behind the
|
|
// topbar menu button.
|
|
test.skip((page.viewportSize()?.width ?? 0) < 768, 'sidebar is hidden on mobile');
|
|
|
|
const nav = page.getByRole('navigation', { name: 'Primary' });
|
|
|
|
await nav.getByRole('link', { name: 'Tasks' }).click();
|
|
await page.waitForURL('**/tasks', { timeout: 10_000 });
|
|
await expect(page.getByRole('heading', { name: /tasks/i })).toBeVisible();
|
|
|
|
await nav.getByRole('link', { name: 'Habits' }).click();
|
|
await page.waitForURL('**/habits', { timeout: 10_000 });
|
|
await expect(page.getByRole('heading', { name: /habits/i })).toBeVisible();
|
|
|
|
await nav.getByRole('link', { name: 'Settings' }).click();
|
|
await page.waitForURL('**/settings', { timeout: 10_000 });
|
|
await expect(page.getByRole('button', { name: 'Appearance' })).toBeVisible();
|
|
});
|
|
});
|