feat: Phase 6 - MCP + Webhooks + Worker + Polish
- MCP server: stateless JSON-RPC 2.0 with 18 tools (tasks, habits, projects, notes, domains, search, activity) - Webhooks API: CRUD routes under /api/domains/[domainId]/webhooks/ with test endpoint and deliveries log - Webhook delivery: HMAC-SHA256 signed POST with retry (exponential backoff, max 6) - Worker rewrite: Drizzle ORM instead of PocketBase, polls jobs table, handles webhook_delivery, recurring_spawn, ai_dispatch - Rate limiting: token bucket per IP/API key (100 req/min REST, 300 req/min MCP) - Keyboard help overlay: ? opens Radix Dialog with search/filter, Esc closes - AI @mention stub: @agent in command palette dispatches CustomEvent - Mobile responsive: bottom nav, single-column kanban, day view calendar, 44px touch targets - Accessibility: skip-to-content link, focus rings, aria-labels, color contrast - E2E tests: mcp.spec.ts, webhooks.spec.ts, realtime.spec.ts added - Schema: api_keys and webhook_deliveries tables with migration - Removed old PocketBase-style database.ts from worker
This commit is contained in:
+7
-57
@@ -5,69 +5,19 @@ test.describe('Dashboard', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await login(page);
|
||||
await page.goto('/dashboard');
|
||||
// Wait for the dashboard page to load
|
||||
await expect(page.getByRole('heading', { name: /dashboard/i })).toBeVisible();
|
||||
});
|
||||
|
||||
test.describe('Dashboard widgets', () => {
|
||||
test('should display dashboard heading and tagline', async ({ page }) => {
|
||||
await expect(page.getByRole('heading', { name: /dashboard/i })).toBeVisible();
|
||||
await expect(page.getByText(/your day, at a glance/i)).toBeVisible();
|
||||
});
|
||||
|
||||
test('should load dashboard widgets', async ({ page }) => {
|
||||
// Wait for widgets to load (they're lazy loaded)
|
||||
// The dashboard uses react-grid-layout with widget cards
|
||||
// Each widget is wrapped in a card with rounded-lg border bg-card
|
||||
await page.waitForTimeout(2_000);
|
||||
|
||||
// Widgets are rendered inside a grid layout
|
||||
// We just verify the page didn't error out
|
||||
await expect(page.getByRole('heading', { name: /dashboard/i })).toBeVisible();
|
||||
});
|
||||
|
||||
test('should render widget grid layout', async ({ page }) => {
|
||||
// The responsive grid layout should be present
|
||||
// Widgets are lazy loaded, so wait for them
|
||||
await page.waitForTimeout(2_000);
|
||||
|
||||
// Verify dashboard renders without error
|
||||
const mainContent = page.locator('main');
|
||||
await expect(mainContent).toBeVisible();
|
||||
});
|
||||
test('should display dashboard with widgets', async ({ page }) => {
|
||||
// Dashboard should show at least one widget area
|
||||
await expect(page.locator('[class*="grid"]').first()).toBeVisible();
|
||||
});
|
||||
|
||||
test.describe('Widget interactions', () => {
|
||||
test('should have interactive widget containers', async ({ page }) => {
|
||||
// Wait for widgets to render
|
||||
await page.waitForTimeout(2_000);
|
||||
|
||||
// Each widget has a drag handle class
|
||||
const dragHandles = page.locator('.widget-drag-handle');
|
||||
const count = await dragHandles.count();
|
||||
|
||||
// Should have at least some widgets
|
||||
if (count > 0) {
|
||||
expect(count).toBeGreaterThan(0);
|
||||
}
|
||||
});
|
||||
test('should show today tasks widget', async ({ page }) => {
|
||||
await expect(page.getByText(/today/i).first()).toBeVisible();
|
||||
});
|
||||
|
||||
test.describe('Quick add widget', () => {
|
||||
test('should display quick add widget', async ({ page }) => {
|
||||
// The quick-add widget should be in the dashboard
|
||||
await page.waitForTimeout(2_000);
|
||||
// Just verify dashboard loaded correctly
|
||||
await expect(page.getByRole('heading', { name: /dashboard/i })).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('Recent activity widget', () => {
|
||||
test('should display recent activity section', async ({ page }) => {
|
||||
await page.waitForTimeout(2_000);
|
||||
// Dashboard should render without errors
|
||||
const mainContent = page.locator('main');
|
||||
await expect(mainContent).toBeVisible();
|
||||
});
|
||||
test('should show activity feed widget', async ({ page }) => {
|
||||
await expect(page.getByText(/activity/i).first()).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user