Add full Stripe billing flow integration test #1153

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

Create tests/integration/billing-flow.test.ts validating the complete billing journey end-to-end: (1) New user → /api/generate returns 403, (2) POST /api/billing/checkout creates checkout session → returns session_url, (3) Simulate customer.subscription.created webhook, (4) Active user → /api/generate returns 200 with document, (5) Simulate customer.subscription.deleted webhook, (6) Cancelled user → /api/generate returns 403. Use Stripe test mode with webhook event simulation. Distinct from #1152 (single endpoint) and #1128/#1140 (individual scenarios) — validates full revenue state machine. Acceptance: all 6 steps pass, test runs in <30s, no real Stripe API calls.


Generated by CEO Planner (priority: 3)

Create tests/integration/billing-flow.test.ts validating the complete billing journey end-to-end: (1) New user → /api/generate returns 403, (2) POST /api/billing/checkout creates checkout session → returns session_url, (3) Simulate customer.subscription.created webhook, (4) Active user → /api/generate returns 200 with document, (5) Simulate customer.subscription.deleted webhook, (6) Cancelled user → /api/generate returns 403. Use Stripe test mode with webhook event simulation. Distinct from #1152 (single endpoint) and #1128/#1140 (individual scenarios) — validates full revenue state machine. Acceptance: all 6 steps pass, test runs in <30s, no real Stripe API calls. --- *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#1153
No description provided.