Add test: POST /api/generate returns 403 when monthly document limit exceeded for plan #848

Open
opened 2026-04-11 23:06:29 -04:00 by pook · 0 comments
Owner

Test the document limit enforcement for subscription plans (complements issue #836).

Create test file:

  1. Mock a user with active 'pro' subscription (e.g., 50 docs/month limit)
  2. Set their current month's document count to exactly the limit
  3. Call POST /api/generate with valid body → assert 403 with error about plan limit
  4. Test with 'business' plan (higher limit, usage under limit) → assert 200
  5. Test with no subscription → assert 402 (subscription required, not 403)
  6. Mock the subscription tier lookup and document count functions

Acceptance: Test passes with 3 cases: over limit (403), under limit (200), no subscription (402).


Generated by CEO Planner (priority: 3)

Test the document limit enforcement for subscription plans (complements issue #836). Create test file: 1. Mock a user with active 'pro' subscription (e.g., 50 docs/month limit) 2. Set their current month's document count to exactly the limit 3. Call POST /api/generate with valid body → assert 403 with error about plan limit 4. Test with 'business' plan (higher limit, usage under limit) → assert 200 5. Test with no subscription → assert 402 (subscription required, not 403) 6. Mock the subscription tier lookup and document count functions Acceptance: Test passes with 3 cases: over limit (403), under limit (200), no subscription (402). --- *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#848
No description provided.