Skip to content

Add tests for the API route src/app/api/admin/feature-flags/route.ts #1403

Description

@RUKAYAT-CODER

Overview

The API route handler src/app/api/admin/feature-flags/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/admin/feature-flags/__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/admin/feature-flags/__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

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions