study-buddy / tests /agents /d3 /test_theming.py
GitHub Actions
deploy d092bea3608b7a29952f16357fda39b7a29e399b
2e818da
Raw
History Blame Contribute Delete
1.1 kB
import pytest
from app.agents.d3 import templates # noqa: F401 (populate registry)
from app.agents.d3.registry import TEMPLATES
@pytest.mark.parametrize("tid", list(TEMPLATES.keys()))
def test_template_uses_cream_navy_theme_and_viewbox(tid):
t = TEMPLATES[tid]
html = t.render(t.golden_sample)
# old dark-theme colors must be fully gone
assert "#0f0f0f" not in html, f"{tid}: stale dark background color #0f0f0f still present"
assert "#e2e8f0" not in html, f"{tid}: stale light text color #e2e8f0 still present"
# new cream background color must be present
assert "#FAF7F2" in html, f"{tid}: new cream background color #FAF7F2 not found"
# no more viewport-derived sizing
assert "window.innerWidth" not in html, f"{tid}: window.innerWidth still referenced"
assert "window.innerHeight" not in html, f"{tid}: window.innerHeight still referenced"
# fit-to-container via viewBox must be present
assert "viewBox" in html, f"{tid}: no viewBox attribute found"
assert "preserveAspectRatio" in html, f"{tid}: no preserveAspectRatio attribute found"