Skip to content

[TEST]: Build a production-like integration test harness for API and database flows #103

Description

@grantfox-oss

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

  • npm test (or the documented package-manager equivalent) works from a clean checkout.
  • Tests never depend on shared developer or production services.
  • Database state is isolated and repeatable across parallel workers.
  • Critical payout/application/support happy paths and forbidden paths are covered.
  • CI publishes test and coverage results with actionable failure logs.
  • Contributor docs explain local prerequisites and focused test commands.

Relevant areas

package.json, src/app/api/**, Prisma schema/client, new tests/integration infrastructure.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions