from fastapi.testclient import TestClient

from grantflow.api.app import app

client = TestClient(app)


def demo_console_body() -> str:
    response = client.get("/demo")
    assert response.status_code == 200
    assert "text/html" in response.headers["content-type"]
    return response.text


def assert_demo_console_tokens(body: str, tokens: list[str]) -> None:
    for token in tokens:
        assert token in body
