Summary
Add integration tests for the access API routes so endpoint behaviour is verified through Fastify rather than only through service-level assumptions.
Current Behaviour
The access API package uses jest --passWithNoTests, so the package can pass CI without route coverage. Core endpoints such as membership lookup, profile lookup, access checks, and member listing are not protected by request-level tests.
Expected Behaviour
Each public API route should have tests that verify request handling, response status codes, payload shapes, and service integration.
Suggested Implementation
Refactor the API bootstrap so tests can create a Fastify instance without binding to a network port. Use app.inject() with either a test database, a mocked Prisma client, or a mocked member service.
Files or Areas Likely Affected
apps/access-api/src/index.ts
apps/access-api/src/routes.ts
apps/access-api/src/services/memberService.ts
apps/access-api/src/**/*.test.ts
apps/access-api/package.json
Acceptance Criteria
Additional Notes
Keep the tests deterministic. Do not require a live external API or deployed contract.
Summary
Add integration tests for the access API routes so endpoint behaviour is verified through Fastify rather than only through service-level assumptions.
Current Behaviour
The access API package uses
jest --passWithNoTests, so the package can pass CI without route coverage. Core endpoints such as membership lookup, profile lookup, access checks, and member listing are not protected by request-level tests.Expected Behaviour
Each public API route should have tests that verify request handling, response status codes, payload shapes, and service integration.
Suggested Implementation
Refactor the API bootstrap so tests can create a Fastify instance without binding to a network port. Use
app.inject()with either a test database, a mocked Prisma client, or a mocked member service.Files or Areas Likely Affected
apps/access-api/src/index.tsapps/access-api/src/routes.tsapps/access-api/src/services/memberService.tsapps/access-api/src/**/*.test.tsapps/access-api/package.jsonAcceptance Criteria
GET /healthGET /v1/memberships/:walletGET /v1/members/:walletfor found and not-found casesPOST /v1/access/checkfor allow and deny decisionsGET /v1/communities/:communityId/membersnpm run -w access-api testAdditional Notes
Keep the tests deterministic. Do not require a live external API or deployed contract.