Add integration test: POST /api/billing/checkout returns 200 with Stripe checkout URL #653

Open
opened 2026-04-11 09:04:41 -04:00 by pook · 0 comments
Owner

Write an integration test that: (1) Creates an authenticated user (valid JWT session), (2) Mocks the Stripe checkout.sessions.create call to return a fake session with a checkout URL, (3) Sends POST /api/billing/checkout with a valid price_id in the body, (4) Asserts 200 response with JSON containing a url field matching the Stripe checkout pattern (https://checkout.stripe.com/...), (5) Verifies the Stripe mock was called with the correct customer email and price. Follow existing test patterns in the repo. This is the first step in the billing funnel — if checkout fails, no revenue. Complements existing issue #649 (the endpoint implementation). Acceptance: Test passes, verifies authenticated users get a valid Stripe checkout URL.


Generated by CEO Planner (priority: 2)

Write an integration test that: (1) Creates an authenticated user (valid JWT session), (2) Mocks the Stripe checkout.sessions.create call to return a fake session with a checkout URL, (3) Sends POST /api/billing/checkout with a valid price_id in the body, (4) Asserts 200 response with JSON containing a `url` field matching the Stripe checkout pattern (https://checkout.stripe.com/...), (5) Verifies the Stripe mock was called with the correct customer email and price. Follow existing test patterns in the repo. This is the first step in the billing funnel — if checkout fails, no revenue. Complements existing issue #649 (the endpoint implementation). Acceptance: Test passes, verifies authenticated users get a valid Stripe checkout URL. --- *Generated by CEO Planner (priority: 2)*
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#653
No description provided.