Skip to content

Issue 32: API Unit/Integration Test Parity #32

@laraibg786

Description

@laraibg786

Goal

Verify that all API endpoints have equivalent unit and integration test coverage. Both test suites validate the same behavior; integration tests verify real database state, unit tests use mocks. No coverage gaps.

Requirements

Functional

  • Audit all existing unit tests (Issue 01: FastAPI scaffold #1 to Issue 22: OpenAPI Spec and Postman Collection #22) and integration tests.
  • Identify and document coverage gaps.
  • Add missing unit tests (mocked DB) for all 13+ endpoints.
  • Add missing integration tests (real DB + RLS) for all 13+ endpoints.
  • Ensure all error codes (4xx, 5xx) have dedicated test cases.
  • Verify RLS enforcement in integration tests (cross-vendor isolation).

Technical

  • Coverage Matrix: All endpoints must have unit + integration + error case tests.
  • Endpoints: POST /auth/signup, POST /auth/login, POST /auth/refresh, POST /licenses, GET /licenses, GET /licenses/{id}, PATCH /licenses/{id}, POST /licenses/{id}/revoke, POST /license-activation/validate, POST /licenses/{id}/activate/session, POST /licenses/heartbeat, GET /audit/export.csv, GET /health.
  • Minimum: ~45 total test cases across all endpoints.

Acceptance Criteria

  • All 13+ endpoints have both unit and integration tests.
  • All error codes (4xx, 5xx) have dedicated test cases.
  • RLS isolation verified in integration tests (Vendor A cannot see Vendor B's data).
  • Coverage report shows >90%.
  • All tests pass in CI.

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions