from dirty_equals import IsDict
from dishka import FromDishka
from httpx import AsyncClient

from tests.web_api.helpers import is_success_response
from tests.web_api.ioc import inject


@inject
async def test_healthcheck(
    http_client: FromDishka[AsyncClient],
) -> None:
    response = await http_client.get("/healthcheck")
    assert is_success_response(response)
    assert response.json() == IsDict({
        "ok": True,
    })
