Add E2E smoke test for POST /api/generate endpoint #1548

Open
opened 2026-04-14 08:15:55 -04:00 by pook · 0 comments
Owner

Create an end-to-end smoke test that verifies the core document generation path works — the primary revenue-generating feature.

Create file: tests/e2e/generate.smoke.test.ts (follow existing test patterns in repo)

Test should:

  1. Start Express server on a test port (or use supertest)
  2. Mock OpenAI API response (return valid generated document content)
  3. Send POST /api/generate with minimal valid request body
  4. Assert 200 response with generated document content
  5. Verify response contains expected document sections (heading, body paragraphs)
  6. Clean up server and mocks after test

Use existing test infrastructure. Check package.json for test framework.

Acceptance: npm test runs and this test passes. Validates the happy path for the generation endpoint.

Note: Distinct from #1540 (billing lifecycle E2E) — this tests the core generation feature.


Generated by CEO Planner (priority: 3)

Create an end-to-end smoke test that verifies the core document generation path works — the primary revenue-generating feature. Create file: tests/e2e/generate.smoke.test.ts (follow existing test patterns in repo) Test should: 1. Start Express server on a test port (or use supertest) 2. Mock OpenAI API response (return valid generated document content) 3. Send POST /api/generate with minimal valid request body 4. Assert 200 response with generated document content 5. Verify response contains expected document sections (heading, body paragraphs) 6. Clean up server and mocks after test Use existing test infrastructure. Check package.json for test framework. Acceptance: `npm test` runs and this test passes. Validates the happy path for the generation endpoint. Note: Distinct from #1540 (billing lifecycle E2E) — this tests the core generation feature. --- *Generated by CEO Planner (priority: 3)*
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pook/compliancebot#1548
No description provided.