feat: Sprint 2 — test coverage, Dependabot, coverage gates, E2E expansion

API Router Integration Tests (43 new tests):
- dashboard-router.test.ts: 11 tests (all 5 queries + RBAC)
- project-router.test.ts: 17 tests (full CRUD + batch ops + RBAC)
- resource-router-crud.test.ts: 15 tests (CRUD + hover card + skill import)
- Fix: mock budget-alerts + cache in existing allocation/timeline tests

E2E Test Suite Expansion (29 new tests, 7 spec files):
- dashboard.spec.ts: widget grid, stat cards, add widget modal
- allocations.spec.ts: list, create modal, filters, column toggle
- estimates.spec.ts: list, wizard steps, navigation
- vacations.spec.ts: self-service, management, team calendar
- staffing.spec.ts: search, suggestions, skill tags
- admin.spec.ts: settings, users, roles, blueprints
- navigation.spec.ts: nav links, sidebar collapse, theme, mobile menu

Coverage Gates:
- api package: 80% lines, 75% branches
- application package: 80% lines, 75% branches (new vitest.config.ts)
- shared package: 70% lines, 65% branches
- CI updated to run per-package vitest --coverage

Dependabot:
- Weekly npm dependency checks with grouped minor+patch
- GitHub Actions version checks
- 10 PR limit for npm, 5 for Actions

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
2026-03-19 21:29:58 +01:00
parent 4118995319
commit 6e5b9ec85b
17 changed files with 1792 additions and 2 deletions
+52
View File
@@ -0,0 +1,52 @@
import { expect, test } from "@playwright/test";
test.describe("Admin Pages", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/auth/signin");
await page.fill('input[type="email"]', "admin@planarchy.dev");
await page.fill('input[type="password"]', "admin123");
await page.click('button[type="submit"]');
await expect(page).toHaveURL(/\/(dashboard|resources)/);
});
test("settings page loads", async ({ page }) => {
await page.goto("/admin/settings");
await page.waitForLoadState("networkidle");
await expect(page.locator("h1", { hasText: /System Settings/i })).toBeVisible({ timeout: 10000 });
});
test("users page loads with user list", async ({ page }) => {
await page.goto("/admin/users");
await page.waitForLoadState("networkidle");
await expect(page.locator("h1", { hasText: /User Management/i })).toBeVisible({ timeout: 10000 });
// Should show a table with at least the admin user
await expect(page.locator("table")).toBeVisible({ timeout: 10000 });
await expect(page.locator("text=admin@planarchy.dev")).toBeVisible({ timeout: 10000 });
});
test("roles page loads", async ({ page }) => {
await page.goto("/roles");
await page.waitForLoadState("networkidle");
await expect(
page.locator("h1").filter({ hasText: /Roles/i }),
).toBeVisible({ timeout: 10000 });
// Should show table or list of roles
await expect(
page.locator("table").or(page.locator("text=No roles")),
).toBeVisible({ timeout: 10000 });
});
test("blueprints page loads", async ({ page }) => {
await page.goto("/admin/blueprints");
await page.waitForLoadState("networkidle");
await expect(
page.locator("h1").filter({ hasText: /Blueprints/i }),
).toBeVisible({ timeout: 10000 });
// Should show blueprint cards or list from seed data
await expect(
page.locator("table")
.or(page.locator("text=3D Content Production"))
.or(page.locator("text=No blueprints")),
).toBeVisible({ timeout: 10000 });
});
});