async def test_health(client):
    resp = await client.get("/health")
    assert resp.status_code == 200
    assert resp.json()["service"] == "identity-access-service"


async def test_auth_config(client):
    resp = await client.get("/api/v1/auth/config")
    assert resp.status_code == 200
    body = resp.json()
    assert "authorization_endpoint" in body
    assert body["client_id"] == "superapp-frontend"


async def test_auth_me_without_token_when_auth_disabled(client):
    # با AUTH_REQUIRED=false در conftest
    resp = await client.get("/api/v1/auth/me")
    assert resp.status_code == 200
    assert resp.json()["roles"]
