forked from 0xWheatyz/SPARC
Add JWT auth flow tests: registration, login, protected routes, token refresh, admin endpoints #407
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?
Summary
The existing API tests in
tests/test_api.pybypass authentication entirely. There is no test coverage for the JWT flow, leaving auth bugs undetected.What to do
Add a new test file
tests/test_auth.py(or extend the existing test file) covering:/auth/registerwith valid data returns 201 and a user object/auth/loginwith valid credentials returns a JWT tokenUse
pytestfixtures andTestClient(orhttpx.AsyncClient).Acceptance Criteria
pytest tests/test_auth.py)Reference
Roadmap: P1 - Test coverage for auth and admin
Triage: Already Implemented
After reviewing the codebase, this issue has already been fully implemented in the current
mainbranch.This issue can be closed.