File size: 1,100 Bytes
2e818da
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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"