from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parents[1] FAMILIES = ROOT / "templates" / "phase_z2" / "families" def test_task11b_three_parallel_uses_dynamic_repeat_grid(): html = (FAMILIES / "three_parallel_requirements.html").read_text(encoding="utf-8") assert "{% for pillar in slot_payload.pillars %}" in html assert "grid-template-columns: 1fr 1fr 1fr" in html assert "font-size: var(--font-sub-title)" in html def test_task11b_three_persona_uses_dynamic_repeat_grid(): html = (FAMILIES / "three_persona_benefits.html").read_text(encoding="utf-8") assert "{% for persona in slot_payload.personas %}" in html assert "repeat(auto-fit, minmax(180px, 1fr))" in html assert "grid-auto-rows: minmax(0, 1fr)" in html def test_task11b_existing_dynamic_partials_remain_loop_based(): pre = (FAMILIES / "pre_construction_model_info_stacked.html").read_text(encoding="utf-8") table = (FAMILIES / "bim_dx_comparison_table.html").read_text(encoding="utf-8") assert "{% for n in range(1, slot_count + 1) %}" in pre assert "{% for row in slot_payload.rows %}" in table def test_task11d_three_parallel_has_compact_autofit_text_policy(): html = (FAMILIES / "three_parallel_requirements.html").read_text(encoding="utf-8") assert "font-size: clamp(7px" not in html assert "font-size: var(--font-body)" in html or ".text-line" in html assert "line-height: clamp(1.2em" in html