Integration Tests for an API Endpoint

Create integration tests for an API endpoint, including success and failure paths.

category:testing
integration-tests
api
backend
0

Prompt

Write integration tests for this API endpoint.
  
  Requirements:
  - Use [testing framework, e.g. Jest + supertest].
  - Test success case(s) with valid input.
  - Test validation errors and authentication/authorization failures if relevant.
  - Assert on both HTTP status codes and response bodies.
  
  Endpoint details:
  
  [Paste route and handler here]