Create comprehensive API tests with proper setup and teardown
Write API integration tests for {{API_ENDPOINT}}:
Endpoint details:
- Method: {{METHOD}}
- Path: {{PATH}}
- Auth: {{AUTH_TYPE}}
Test cases to cover:
1. Happy path (200/201 response)
2. Validation errors (400)
3. Authentication errors (401/403)
4. Not found (404)
5. Rate limiting (429)
6. Server errors (500)
7. Edge cases (empty body, missing fields, extra fields)
8. Pagination (if applicable)
9. Filtering and sorting (if applicable)
Provide:
- Test file with all test cases
- Test setup (database seeding, auth tokens)
- Test teardown (cleanup)
- Mock external services
- Test data factories
- CI/CD integrationTesting API endpoints