feat: full plan execution - CI/CD, critical fixes, UX polish, secondary/advanced features, E2E + docs
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.
This commit is contained in:
+56
-35
@@ -1,5 +1,6 @@
|
||||
import { test, expect } from '@playwright/test';
|
||||
import { login } from './helpers/auth';
|
||||
import { testCalendarEvents } from './helpers/fixtures';
|
||||
|
||||
test.describe('Calendar', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
@@ -8,47 +9,67 @@ test.describe('Calendar', () => {
|
||||
await expect(page.getByRole('heading', { name: /calendar/i })).toBeVisible();
|
||||
});
|
||||
|
||||
test('should display calendar with month view by default', async ({ page }) => {
|
||||
// Month view should be visible
|
||||
await expect(page.getByText(/today/i)).toBeVisible();
|
||||
/** Fill the New Event dialog and submit it, returning the POST response. */
|
||||
async function createEvent(page: import('@playwright/test').Page, title: string) {
|
||||
await page.getByRole('button', { name: /new event/i }).first().click();
|
||||
|
||||
const dialog = page.getByRole('dialog');
|
||||
await expect(dialog).toBeVisible();
|
||||
await expect(dialog.getByRole('heading', { name: 'New Event' })).toBeVisible();
|
||||
|
||||
await dialog.getByLabel('Title').fill(title);
|
||||
|
||||
// The API requires an ISO start time; schedule the event for today so it
|
||||
// lands in the current month view.
|
||||
const pad = (n: number) => String(n).padStart(2, '0');
|
||||
const start = new Date();
|
||||
const end = new Date(start.getTime() + 60 * 60 * 1000);
|
||||
const toLocal = (d: Date) =>
|
||||
`${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
|
||||
await dialog.getByLabel('Start').fill(toLocal(start));
|
||||
await dialog.getByLabel('End').fill(toLocal(end));
|
||||
|
||||
const createResponse = page.waitForResponse(
|
||||
(resp) => resp.url().includes('/api/calendar/events') && resp.request().method() === 'POST',
|
||||
);
|
||||
await dialog.getByRole('button', { name: /create event/i }).click();
|
||||
await createResponse;
|
||||
await expect(dialog).toBeHidden();
|
||||
}
|
||||
|
||||
test('renders the calendar page', async ({ page }) => {
|
||||
// react-big-calendar only mounts once events exist; otherwise a friendly
|
||||
// empty state is shown. Accept either so a fresh DB still passes.
|
||||
await expect(
|
||||
page.getByText(/no events yet/i).or(page.locator('.rbc-calendar-container')),
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
test('should switch between month, week, and day views', async ({ page }) => {
|
||||
// Click week view
|
||||
const weekBtn = page.getByRole('button', { name: /week/i });
|
||||
if (await weekBtn.isVisible()) {
|
||||
await weekBtn.click();
|
||||
await page.waitForTimeout(500);
|
||||
}
|
||||
test('creates an event via the New Event dialog', async ({ page }) => {
|
||||
await createEvent(page, testCalendarEvents.title);
|
||||
|
||||
// Click day view
|
||||
const dayBtn = page.getByRole('button', { name: /day/i });
|
||||
if (await dayBtn.isVisible()) {
|
||||
await dayBtn.click();
|
||||
await page.waitForTimeout(500);
|
||||
}
|
||||
|
||||
// Click month view
|
||||
const monthBtn = page.getByRole('button', { name: /month/i });
|
||||
if (await monthBtn.isVisible()) {
|
||||
await monthBtn.click();
|
||||
await page.waitForTimeout(500);
|
||||
}
|
||||
// The calendar now renders and the event shows up on it.
|
||||
await expect(page.locator('.rbc-calendar-container')).toBeVisible({ timeout: 10_000 });
|
||||
await expect(
|
||||
page.locator('.rbc-event').filter({ hasText: testCalendarEvents.title }),
|
||||
).toBeVisible({ timeout: 10_000 });
|
||||
});
|
||||
|
||||
test('should navigate between months', async ({ page }) => {
|
||||
// Click next month
|
||||
const nextBtn = page.getByRole('button', { name: /next/i });
|
||||
if (await nextBtn.isVisible()) {
|
||||
await nextBtn.click();
|
||||
await page.waitForTimeout(500);
|
||||
test('switches between month, week, and day views', async ({ page }) => {
|
||||
// The toolbar only exists when the calendar is rendered, so make sure at
|
||||
// least one event exists first.
|
||||
if (!(await page.locator('.rbc-calendar-container').isVisible().catch(() => false))) {
|
||||
await createEvent(page, `${testCalendarEvents.title} view`);
|
||||
}
|
||||
|
||||
// Click previous month
|
||||
const prevBtn = page.getByRole('button', { name: /prev/i });
|
||||
if (await prevBtn.isVisible()) {
|
||||
await prevBtn.click();
|
||||
await page.waitForTimeout(500);
|
||||
}
|
||||
await expect(page.locator('.rbc-calendar-container')).toBeVisible({ timeout: 10_000 });
|
||||
await page.getByRole('button', { name: 'Week', exact: true }).click();
|
||||
await expect(page.locator('.rbc-calendar-container')).toBeVisible();
|
||||
|
||||
await page.getByRole('button', { name: 'Day', exact: true }).click();
|
||||
await expect(page.locator('.rbc-calendar-container')).toBeVisible();
|
||||
|
||||
await page.getByRole('button', { name: 'Month', exact: true }).click();
|
||||
await expect(page.locator('.rbc-calendar-container')).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user