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:
@@ -0,0 +1,64 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.describe("Allocations", () => {
|
||||
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)/);
|
||||
await page.goto("/allocations");
|
||||
});
|
||||
|
||||
test("allocation list loads with table", async ({ page }) => {
|
||||
await page.waitForLoadState("networkidle");
|
||||
// The page title should be visible
|
||||
await expect(
|
||||
page.locator("h1").filter({ hasText: /Allocations|Planning/i }),
|
||||
).toBeVisible({ timeout: 10000 });
|
||||
// Table or empty state should be present
|
||||
await expect(
|
||||
page.locator("table").or(page.locator("text=No allocations")),
|
||||
).toBeVisible({ timeout: 10000 });
|
||||
});
|
||||
|
||||
test("new planning entry modal opens", async ({ page }) => {
|
||||
await page.waitForLoadState("networkidle");
|
||||
const newBtn = page.locator("button", { hasText: /New Planning Entry/i });
|
||||
await expect(newBtn).toBeVisible({ timeout: 10000 });
|
||||
await newBtn.click();
|
||||
// Modal should appear with form fields
|
||||
await expect(
|
||||
page.locator("[role='dialog']").or(page.locator("text=Create").or(page.locator("text=Project"))),
|
||||
).toBeVisible({ timeout: 5000 });
|
||||
await page.keyboard.press("Escape");
|
||||
});
|
||||
|
||||
test("filter by status works", async ({ page }) => {
|
||||
await page.waitForLoadState("networkidle");
|
||||
// Look for status filter chips or dropdown
|
||||
const statusFilter = page.locator("button", { hasText: /Proposed|Confirmed|Active|Status/i }).first();
|
||||
if ((await statusFilter.count()) > 0) {
|
||||
await statusFilter.click();
|
||||
await page.waitForTimeout(300);
|
||||
// After clicking a status filter, the page should still show the table
|
||||
await expect(
|
||||
page.locator("table").or(page.locator("text=No allocations")),
|
||||
).toBeVisible();
|
||||
}
|
||||
});
|
||||
|
||||
test("column toggle panel works", async ({ page }) => {
|
||||
await page.waitForLoadState("networkidle");
|
||||
const colToggle = page.locator("button", { hasText: /Columns/i });
|
||||
if ((await colToggle.count()) > 0) {
|
||||
await colToggle.click();
|
||||
await page.waitForTimeout(300);
|
||||
// A panel or dropdown with column checkboxes should appear
|
||||
await expect(
|
||||
page.locator("input[type='checkbox']").first(),
|
||||
).toBeVisible({ timeout: 3000 });
|
||||
await page.keyboard.press("Escape");
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user