"""Tests for dashboard routes.""" from fastapi.testclient import TestClient class TestDashboard: """Tests for GET /dashboard.""" def test_dashboard_requires_profile(self, client: TestClient) -> None: """GET /dashboard should redirect to / without profile cookie.""" response = client.get("/dashboard", follow_redirects=False) assert response.status_code == 302 assert response.headers["location"] == "/" class TestExerciseProgress: """Tests for GET /dashboard/exercise/.""" def test_exercise_progress_requires_profile(self, client: TestClient) -> None: """GET /dashboard/exercise/1 should redirect to / without profile cookie.""" response = client.get("/dashboard/exercise/1", follow_redirects=False) assert response.status_code == 302 assert response.headers["location"] == "/"