Skip to content

Add tests for the API route src/app/api/certificates/verify/[id]/route.ts #1416

Description

@RUKAYAT-CODER

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions