forked from 0xWheatyz/SPARC
Tests: add JWT auth flow tests covering registration, login, protected routes, and admin endpoints #522
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 in
tests/test_api.pybypass authentication entirely. There is no test coverage for the JWT flow, leaving auth bugs undetected.Task
Add a new test file
tests/test_auth.pythat covers:Acceptance Criteria
tests/test_auth.pyexists and all tests pass withpytestTestClientorhttpx.AsyncClientVerified complete:
tests/test_auth.pyexists with comprehensive JWT auth flow tests covering registration, login, protected routes, token validation, and admin endpoints using FastAPI TestClient with mocked database. Closing as implemented.