23 lines
734 B
Python
23 lines
734 B
Python
"""Tests for HTML page routes."""
|
|
|
|
from fastapi.testclient import TestClient
|
|
|
|
|
|
class TestHomePage:
|
|
"""Tests for GET /."""
|
|
|
|
def test_home_returns_200(self, client: TestClient) -> None:
|
|
"""GET / should return HTTP 200."""
|
|
response = client.get("/")
|
|
assert response.status_code == 200
|
|
|
|
def test_home_contains_app_name(self, client: TestClient) -> None:
|
|
"""GET / should render HTML containing the app name."""
|
|
response = client.get("/")
|
|
assert "SneakySwole" in response.text
|
|
|
|
def test_home_has_dark_theme(self, client: TestClient) -> None:
|
|
"""GET / should use the dark theme."""
|
|
response = client.get("/")
|
|
assert 'data-theme="dark"' in response.text
|