feat(#244): add E2E tests for pre-PR quality gate lifecycle (#231)#
Problem#
No E2E coverage existed for the quality gate introduced in #231, leaving the gate-block, approve-bypass, override-consume, quick-passthrough, and malformed-directive paths untested against a real database.
Task / Link#
Closes #244 — GitHub Issue
Changes#
- Created
test/quality-gate.e2e-spec.tswith 8 E2E scenarios - Tests use real
TaskStateService(in-memory SQLite) + realPhaseRouterServicewith mocked Claude/external deps - Covers: auto/careful gate blocks, approve-directive gate release,
qualityGateOverrideconsumed on deliver, quick bypass, malformed directive (wrong casing) rejected - All test descriptions reference
#231for traceability - Lint auto-fix applied to
src/metrics/metrics.service.spec.ts(line formatting only)
Notes#
- Tests run under
npm run test:e2e(pattern:.e2e-spec.ts), consistent with other files intest/ - With a real
TaskStateService,qualityGateOverrideis consumed beforebuildEnvis called — the env does NOT includeQUALITY_GATE_OVERRIDE=1; tests document actual behavior
Testing#
npx jest --config ./test/jest-e2e.json --testPathPatterns quality-gate— 8/8 passnpm run test— 674/674 pass (no regression)npm run lint— 0 errors