from httpx import AsyncClient from tests.conftest import auth_header class TestDashboard: async def test_get_stats(self, client: AsyncClient, admin_token): resp = await client.get("/api/v1/dashboard/stats", headers=auth_header(admin_token)) assert resp.status_code == 200 data = resp.json() assert "ticket_total" in data assert "instance_total" in data assert "user_total" in data async def test_unauthenticated(self, client: AsyncClient): resp = await client.get("/api/v1/dashboard/stats") assert resp.status_code in (401, 403)