Context
The repository has no test script or visible automated suite despite complex role, database, storage, email, and blockchain behavior. Unit-only coverage would not catch route/schema mismatches or transaction failures.
Scope
- Add a test runner and ephemeral PostgreSQL/Supabase-compatible integration environment.
- Create deterministic factories for users, roles, payouts, milestones, applications, and support tickets.
- Exercise route handlers through HTTP with real migrations and database constraints.
- Stub external boundaries (email, storage, Stellar/Trustless Work) through explicit adapters.
- Cover authentication, authorization, lifecycle transitions, concurrency, pagination, and error contracts.
- Isolate tests for parallel execution and provide failure diagnostics.
Acceptance criteria
Relevant areas
package.json, src/app/api/**, Prisma schema/client, new tests/integration infrastructure.
Context
The repository has no test script or visible automated suite despite complex role, database, storage, email, and blockchain behavior. Unit-only coverage would not catch route/schema mismatches or transaction failures.
Scope
Acceptance criteria
npm test(or the documented package-manager equivalent) works from a clean checkout.Relevant areas
package.json,src/app/api/**, Prisma schema/client, newtests/integrationinfrastructure.