Overview
The API route handler src/app/api/certificates/verify/[id]/route.ts has no colocated test. Route handlers encode request validation, status codes and error handling that are easy to break; a focused test locks in the contract.
Specifications
Features:
- The route has tests for its success and failure responses.
Tasks:
- Add
src/app/api/certificates/verify/[id]/__tests__/route.test.ts that invokes the exported handler(s) with a mocked Request and asserts: a valid request returns the expected status/body, and an invalid request (bad/missing body or params) returns the expected 4xx.
Impacted Files:
src/app/api/certificates/verify/[id]/__tests__/route.test.ts
Acceptance Criteria
- The route's success and validation-failure paths are covered by passing tests.
- All the CI passes
- Star the repo
Overview
The API route handler
src/app/api/certificates/verify/[id]/route.tshas no colocated test. Route handlers encode request validation, status codes and error handling that are easy to break; a focused test locks in the contract.Specifications
Features:
Tasks:
src/app/api/certificates/verify/[id]/__tests__/route.test.tsthat invokes the exported handler(s) with a mockedRequestand asserts: a valid request returns the expected status/body, and an invalid request (bad/missing body or params) returns the expected 4xx.Impacted Files:
src/app/api/certificates/verify/[id]/__tests__/route.test.tsAcceptance Criteria