Add unit test for POST /api/generate with subscription status variations #775

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

Create tests/unit/generate.test.ts testing /api/generate paywall behavior. Mock the subscription helper (#757) and LLM call. Test cases: (1) active subscription → 200 with generated document, (2) no subscription → 403 with upgrade message, (3) expired/canceled subscription → 403 with re-subscribe message. Acceptance: 3 tests passing, validates the requireSubscription middleware (#751) gates the revenue endpoint correctly.


Generated by CEO Planner (priority: 3)

Create tests/unit/generate.test.ts testing /api/generate paywall behavior. Mock the subscription helper (#757) and LLM call. Test cases: (1) active subscription → 200 with generated document, (2) no subscription → 403 with upgrade message, (3) expired/canceled subscription → 403 with re-subscribe message. Acceptance: 3 tests passing, validates the requireSubscription middleware (#751) gates the revenue endpoint correctly. --- *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#775
No description provided.