from types import SimpleNamespace from phase_z2_pipeline import ( _build_verbatim_cards_n_grid, _frame_expansion_trace, ) def _unit_with_groups(count: int): raw = "\n\n".join( f"- **Group {i}**\n - Item {i}" for i in range(1, count + 1) ) return SimpleNamespace(title="Title", raw_content=raw) def test_task27_repeatable_frame_reports_covered_via_expand(): payload = _build_verbatim_cards_n_grid( _unit_with_groups(6), slot_count=4, label_pattern="quadrant_{n}_label", body_pattern="quadrant_{n}_body", ) trace = _frame_expansion_trace("bim_issues_quadrant_four", payload) assert trace["coverage_state"] == "covered_via_expand" assert trace["expanded"] is True assert trace["base_items"] == 4 assert trace["actual_items"] == 6 assert trace["font_policy"] == "no_font_shrink" def test_task27_base_count_frame_reports_covered_native(): payload = _build_verbatim_cards_n_grid( _unit_with_groups(4), slot_count=4, label_pattern="quadrant_{n}_label", body_pattern="quadrant_{n}_body", ) trace = _frame_expansion_trace("bim_issues_quadrant_four", payload) assert trace["coverage_state"] == "covered_native" assert trace["expanded"] is False assert trace["actual_items"] == 4