Skip to content

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

Open

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

  1. guptakumarranjeet150 commented on Sep 17, 2026

    @guptakumarranjeet150

    Hello! I would like to work on this issue.

    I would love to take this on. My planned approach:

    • Create reproduction and validation suites for Add tests for the API route src/app/api/certificates/verify/[id]/route.ts to ensure regression-free behavior.
    • Validate both positive flows and negative/revert branches.

    Happy to pick this up today—please assign to me!

  2. Ranjeet2063 commented on Sep 30, 2026

    @Ranjeet2063

    Hi team,

    I would like to take on and implement this issue: Add tests for the API route src/app/api/certificates/verify/[id]/route.ts.

    Technical Implementation Roadmap:

    1. Formal Soroban Invariant Design: Audit storage layout (Instance, Persistent, Temporary) with strict TTL management and explicit require_auth guards.
    2. Core Rust WASM Implementation: Implement deterministic state transition handlers eliminating arithmetic overflow risks using checked/saturating math.
    3. Hermetic Testing Suite: Build comprehensive test cases in tests/ asserting authorized vs unauthorized invocations, mock auth environments, and edge value bounds.
    4. Gas & Footprint Optimization: Profile CPU/memory instruction budgets under Soroban host environment to ensure optimal runtime efficiency.

    Ready to implement and deliver a production-grade PR following all repository standards. Please feel free to assign!

  3. hussnainahmedd commented on Oct 1, 2026

    @hussnainahmedd

    Hi! I'd like to work on this issue. I plan to add src/app/api/certificates/verify/[id]/__tests__/route.test.ts covering the success path (200 with validated payload), the not-found path (404), schema validation failure (500), and service errors (500), following the repo's existing route-test patterns. Please assign it to me. Thanks!

  4. hussnainahmedd commented on Oct 2, 2026

    @hussnainahmedd

    Hi @Ranjeet2063 — this is already being worked on: PR #1643 adds the route tests for src/app/api/certificates/verify/[id]/route.ts and is open for review. To avoid duplicate work, please pick another issue or help review the PR. Thanks!

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