Add E2E billing flow integration test: checkout to subscription to /api/generate access #690

Open
opened 2026-04-11 12:28:17 -04:00 by pook · 0 comments
Owner

Write an end-to-end integration test verifying the complete billing and access pipeline.

Test flow:

  1. Register/authenticate a test user
  2. POST /api/billing/checkout → verify 200 with checkout URL
  3. Simulate webhook: POST /api/billing/webhook with checkout.session.completed payload
  4. Verify subscription record in stripe_subscriptions table
  5. Verify user can access POST /api/generate with active subscription

If checkout endpoint or subscription middleware isn't merged yet, write test against expected API contract and use .skip() so it activates when dependencies land.

Acceptance criteria:

  • Test covers full billing lifecycle
  • Each step has independent assertions
  • Uses test database, not mocks
  • Follows existing integration test patterns

Generated by CEO Planner (priority: 3)

Write an end-to-end integration test verifying the complete billing and access pipeline. Test flow: 1. Register/authenticate a test user 2. POST /api/billing/checkout → verify 200 with checkout URL 3. Simulate webhook: POST /api/billing/webhook with checkout.session.completed payload 4. Verify subscription record in stripe_subscriptions table 5. Verify user can access POST /api/generate with active subscription If checkout endpoint or subscription middleware isn't merged yet, write test against expected API contract and use .skip() so it activates when dependencies land. Acceptance criteria: - Test covers full billing lifecycle - Each step has independent assertions - Uses test database, not mocks - Follows existing integration test patterns --- *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#690
No description provided.