forked from 0xWheatyz/SPARC
Add JWT auth flow tests covering registration, login, protected routes, token refresh, and admin endpoints #45
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?
Problem
The existing test suite in
tests/test_api.pybypasses authentication entirely. The JWT registration, login, token refresh, protected-route access, and admin-only endpoint paths have no automated test coverage. Auth regressions can ship undetected.Task
tests/test_auth.py) covering:TestClientfromhttpxorstarlette).Acceptance Criteria
pytest tests/test_auth.pypasses with all cases above covered.auth.pyreaches at least 80%.References
Roadmap: P1 -- Test coverage for auth and admin.
Closing: Already implemented in PR #35 (test(auth): add comprehensive JWT authentication test suite). tests/test_auth.py contains the full test suite.