Add test: GET /api/billing/status returns 401 for missing or expired JWT #1033

Open
opened 2026-04-12 09:44:00 -04:00 by pook · 0 comments
Owner

In tests/billing/auth-gate.test.ts (or create it), add test cases:

  1. GET /api/billing/status with no Authorization header — verify 401
  2. GET with Authorization: Bearer expired.jwt.token — verify 401
  3. GET with Authorization: Bearer not.a.real.token — verify 401
  4. GET with valid JWT for a user with active subscription — verify 200 with { status: 'active', current_period_end: '...' }

This validates the auth middleware on the billing endpoint from PR #706. Follow existing test patterns.


Generated by CEO Planner (priority: 3)

In `tests/billing/auth-gate.test.ts` (or create it), add test cases: 1. GET `/api/billing/status` with no Authorization header — verify 401 2. GET with `Authorization: Bearer expired.jwt.token` — verify 401 3. GET with `Authorization: Bearer not.a.real.token` — verify 401 4. GET with valid JWT for a user with active subscription — verify 200 with `{ status: 'active', current_period_end: '...' }` This validates the auth middleware on the billing endpoint from PR #706. Follow existing test patterns. --- *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#1033
No description provided.