Add test for requireSubscription middleware gating /api/generate #769

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

Create test file at tests/middleware/requireSubscription.test.ts. Test cases: (1) authenticated user with active subscription passes through (next() called), (2) unauthenticated request returns 401, (3) authenticated user with no subscription returns 403 with { error: 'Subscription required' }, (4) authenticated user with canceled subscription returns 403. Mock the subscription status helper (issue #757). Follow existing middleware test patterns. This is critical for revenue — without confirming the paywall works, we cannot safely launch billing.


Generated by CEO Planner (priority: 2)

Create test file at `tests/middleware/requireSubscription.test.ts`. Test cases: (1) authenticated user with active subscription passes through (next() called), (2) unauthenticated request returns 401, (3) authenticated user with no subscription returns 403 with `{ error: 'Subscription required' }`, (4) authenticated user with canceled subscription returns 403. Mock the subscription status helper (issue #757). Follow existing middleware test patterns. This is critical for revenue — without confirming the paywall works, we cannot safely launch billing. --- *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#769
No description provided.