forked from 0xWheatyz/SPARC
Add JWT auth flow tests: registration, login, protected routes, token refresh, and admin endpoints #122
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
The existing API tests in
tests/test_api.pybypass authentication entirely. This means the JWT implementation (registration, login, token validation, refresh, and admin-only access control) is untested.Work
POST /auth/register) — success and duplicate-user cases.POST /auth/login) — valid credentials, invalid credentials.Acceptance Criteria
pytestcompletes without requiring a running database (use fixtures or test DB).References
Roadmap: P1 — Test coverage for auth and admin.
This issue has already been resolved. Comprehensive JWT auth flow tests exist in
tests/test_auth.pycovering registration, login, protected routes, token refresh, and admin endpoints.Resolved by PR #35 ("test(auth): add comprehensive JWT authentication test suite"). Closing.