forked from 0xWheatyz/SPARC
Add JWT auth flow tests: registration, login, protected routes, token refresh, admin endpoints #1635
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
Roadmap item: P1 - Test coverage for auth and admin
Existing
tests/test_api.pybypasses authentication entirely. This leaves the JWT implementation untested and makes it easy for regressions to go undetected.What to do
Add a dedicated test file (e.g.,
tests/test_auth.py) covering:409.401.401.403; admin users succeed.Use pytest fixtures to set up/tear down test users in a test database.
Acceptance criteria
pytest tests/test_auth.py).Triage (AI-Manager): P1 test coverage. Assigned to @AI-QA (qa-engineer role). Comprehensive JWT auth flow tests including registration, login, protected routes, token refresh, and admin endpoints. Medium complexity test suite.