fix: stabilize the live recommendation path
Some checks are pending
ci / backend (push) Waiting to run
ci / frontend (push) Waiting to run

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Justin Visser 2026-08-12 10:47:30 +02:00
parent bfea9efb5e
commit dbc5c2d93f
12 changed files with 113 additions and 31 deletions

View file

@ -52,7 +52,10 @@ def test_login_callback_cookie_and_current_user_flow() -> None:
assert "discovery_session=" in callback_response.headers["set-cookie"]
assert "HttpOnly" in callback_response.headers["set-cookie"]
assert "SameSite=lax" in callback_response.headers["set-cookie"]
assert client.get("/api/auth/me").json() == {"display_name": "Ada Listener"}
assert client.get("/api/auth/me").json() == {
"display_name": "Ada Listener",
"can_logout": True,
}
def test_unknown_callback_state_redirects_to_login_error() -> None:
@ -108,9 +111,16 @@ def test_seed_session_authenticates_requests_without_a_cookie() -> None:
)
with TestClient(app) as client:
response = client.get("/api/auth/me")
logout_response = client.post("/api/auth/logout")
after_logout_response = client.get("/api/auth/me")
assert response.status_code == 200
assert response.json() == {"display_name": "Seed Listener"}
assert response.json() == {"display_name": "Seed Listener", "can_logout": False}
assert logout_response.status_code == 204
assert after_logout_response.json() == {
"display_name": "Seed Listener",
"can_logout": False,
}
def test_seed_session_failure_keeps_application_serving() -> None: