mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-12-03 03:07:17 +00:00
Backend tests (9 new files): - summary-service, metrics-helpers, template-service - status-history-service, trace-service, diff-service - conflict-service, preview-service, digest-service - Coverage: 44.27% → 53.52% (897 tests passing) E2E tests (fixed + hardened): - Removed debug spec left by sub-agent - API seed calls now hit backend directly (port 3001) to avoid IPv6/Vite proxy issues on macOS - task-status tests use unique names (prevent strict mode) - Added waitForResponse for status change assertions - Enabled webServer auto-start in playwright.config.ts - All 19 E2E tests passing
65 lines
2 KiB
TypeScript
65 lines
2 KiB
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { bypassAuth, seedTestTask, deleteTask, cleanupRoutes } from './helpers/auth';
|
|
|
|
test.describe('Task List', () => {
|
|
let testTaskId: string | null = null;
|
|
|
|
test.beforeEach(async ({ page }) => {
|
|
await bypassAuth(page);
|
|
});
|
|
|
|
test.afterEach(async ({ page }) => {
|
|
if (testTaskId) {
|
|
await deleteTask(page, testTaskId).catch(() => {});
|
|
testTaskId = null;
|
|
}
|
|
await cleanupRoutes(page);
|
|
});
|
|
|
|
test('tasks appear on the board', async ({ page }) => {
|
|
// Seed a known task
|
|
const task = await seedTestTask(page, {
|
|
title: 'E2E Visible Task',
|
|
status: 'todo',
|
|
priority: 'high',
|
|
});
|
|
testTaskId = (task as { id: string }).id;
|
|
|
|
await page.goto('/');
|
|
|
|
// The kanban board should show the seeded task
|
|
const taskCard = page.locator(`text=E2E Visible Task`);
|
|
await expect(taskCard).toBeVisible({ timeout: 10_000 });
|
|
});
|
|
|
|
test('tasks appear in the correct column', async ({ page }) => {
|
|
const task = await seedTestTask(page, {
|
|
title: 'E2E Column Check Task',
|
|
status: 'in-progress',
|
|
priority: 'medium',
|
|
});
|
|
testTaskId = (task as { id: string }).id;
|
|
|
|
await page.goto('/');
|
|
|
|
// Find the in-progress column and verify the task is inside it
|
|
const inProgressCol = page.getByRole('region', { name: /In Progress column/ });
|
|
await expect(inProgressCol).toBeVisible({ timeout: 15_000 });
|
|
await expect(inProgressCol.locator('text=E2E Column Check Task')).toBeVisible({
|
|
timeout: 10_000,
|
|
});
|
|
});
|
|
|
|
test('multiple tasks render without errors', async ({ page }) => {
|
|
await page.goto('/');
|
|
|
|
// Wait for the board to load
|
|
await expect(page.getByRole('region', { name: /To Do column/ })).toBeVisible({
|
|
timeout: 15_000,
|
|
});
|
|
|
|
// The page should not have any error messages visible
|
|
await expect(page.locator('text=Connection Error')).not.toBeVisible();
|
|
await expect(page.locator('text=Something went wrong')).not.toBeVisible();
|
|
});
|
|
});
|