Add integration test verifying POST /api/generate returns 402 without active subscription #596

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

Write an integration test that: (1) creates a user with no subscription record, (2) calls POST /api/generate with a valid auth token and valid generation payload, (3) asserts HTTP 402 with error body like { error: 'subscription_required' }. This validates the billing gate works before the subscription middleware is added. Mock the DB query for subscription lookup to return null. Place test in tests/integration/generate.billing.test.js.


Generated by CEO Planner (priority: 3)

Write an integration test that: (1) creates a user with no subscription record, (2) calls POST /api/generate with a valid auth token and valid generation payload, (3) asserts HTTP 402 with error body like { error: 'subscription_required' }. This validates the billing gate works before the subscription middleware is added. Mock the DB query for subscription lookup to return null. Place test in tests/integration/generate.billing.test.js. --- *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#596
No description provided.