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,42 @@
|
||||
import { expect, test } from "@playwright/test";
|
||||
|
||||
test.describe("Staffing", () => {
|
||||
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("/staffing");
|
||||
});
|
||||
|
||||
test("staffing page loads with search form", async ({ page }) => {
|
||||
await page.waitForLoadState("networkidle");
|
||||
await expect(page.locator("h1", { hasText: /Staffing Suggestions/i })).toBeVisible({ timeout: 10000 });
|
||||
// Search form should have skill input, date fields, and a search button
|
||||
await expect(page.locator("text=How scoring works")).toBeVisible({ timeout: 10000 });
|
||||
});
|
||||
|
||||
test("search form has default skill tags", async ({ page }) => {
|
||||
await page.waitForLoadState("networkidle");
|
||||
// The StaffingPanel pre-populates with TypeScript and React skill tags
|
||||
await expect(
|
||||
page.locator("text=TypeScript").or(page.locator("text=React")),
|
||||
).toBeVisible({ timeout: 10000 });
|
||||
});
|
||||
|
||||
test("submitting search returns suggestions or empty state", async ({ page }) => {
|
||||
await page.waitForLoadState("networkidle");
|
||||
// Click the search/submit button
|
||||
const searchBtn = page.locator("button", { hasText: /Search|Find|Suggest/i }).first();
|
||||
await expect(searchBtn).toBeVisible({ timeout: 10000 });
|
||||
await searchBtn.click();
|
||||
await page.waitForTimeout(1000);
|
||||
// After search, should show either suggestion cards or a "no suggestions" message
|
||||
await expect(
|
||||
page.locator("text=/Score|Availability|No suggestions|No matching/i").first()
|
||||
.or(page.locator("[data-suggestion]").first())
|
||||
.or(page.locator("table").first()),
|
||||
).toBeVisible({ timeout: 15000 });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user