You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relevant files: frontend/package.json, frontend/package-lock.json, new Vitest setup/configuration, focused source helpers/components, root package.json, and CI only if the tests cannot be folded into frontend:verify
Current behavior: the frontend relies on type checking, build, lint, and coarse portal E2E with no unit/component test framework.
Desired behavior: risky normalization, serialization, and request-state behavior has fast hermetic regression coverage.
Implementation Notes
Use Vitest, jsdom, and React Testing Library in the existing Vite stack.
Extract only the minimum pure seams required for testing; do not refactor the full Generate route.
Mock fetch and filesystem/browser boundaries.
Keep all tests offline and fixture-driven.
Acceptance Criteria
frontend:test runs a hermetic Vitest suite.
Tests cover generation request/error normalization and result/reference URL handling.
Tests cover library rating/totals normalization and CSV/manifest escaping.
At least one stateful component renders success and error states.
CI or frontend:verify invokes the new suite exactly once.
Existing frontend build, lint, type check, and portal E2E remain green.
Tests/Evals
Use focused behavior assertions rather than full-page snapshots.
No provider calls, credentials, local outputs, or live servers beyond existing hermetic harnesses.
Verification
npm --prefix frontend ci
npm run frontend:test
npm run frontend:verify
npm run e2e:portal
npm test
Agent Instructions
Use branch codex/issue-<this-issue>-frontend-test-foundation.
Summary
Add a focused frontend unit and component regression-test foundation around the portal's highest-risk pure behavior.
Context
frontend/package.jsonandfrontend/package-lock.json.frontend/package.json,frontend/package-lock.json, new Vitest setup/configuration, focused source helpers/components, rootpackage.json, and CI only if the tests cannot be folded intofrontend:verifyImplementation Notes
fetchand filesystem/browser boundaries.Acceptance Criteria
frontend:testruns a hermetic Vitest suite.frontend:verifyinvokes the new suite exactly once.Tests/Evals
Verification
npm --prefix frontend cinpm run frontend:testnpm run frontend:verifynpm run e2e:portalnpm testAgent Instructions
codex/issue-<this-issue>-frontend-test-foundation.mainis green.Human Checkpoints
Out of Scope
Linear
Not applicable. Rafiki delivery is GitHub-only; do not create or update a Linear issue.