@@ -145,6 +145,25 @@ def test_to_html_renders_reference_baseline_section(mock_profile_result):
145145 assert "-5.0 pp" in html_out
146146
147147
148+ def test_to_html_reports_reference_groups_omitted_by_display_cap (mock_profile_result ):
149+ """Mirrors test_to_html_reports_groups_omitted_by_display_cap for the
150+ reference-baseline sub-table, which was silently truncated with no
151+ dim-more notice."""
152+ mock_profile_result ["dimensions" ][0 ]["reference" ] = {
153+ "deviation" : 0.1 ,
154+ "groups" : [
155+ {"label" : f"Group { i } " , "expected" : 1 / 15 , "actual" : 1 / 15 , "delta" : 0.0 }
156+ for i in range (15 )
157+ ],
158+ }
159+
160+ html_out = to_html (mock_profile_result )
161+
162+ assert "Group 11" in html_out
163+ assert "Group 12" not in html_out
164+ assert '<div class="dim-more">… and 3 more groups</div>' in html_out
165+
166+
148167def test_to_html_omits_reference_section_when_absent (mock_profile_result ):
149168 html_out = to_html (mock_profile_result )
150169
@@ -268,6 +287,25 @@ def test_to_terminal_truncates_a_long_reference_group_label(mock_profile_result)
268287 assert ref_label not in out
269288
270289
290+ def test_to_terminal_reports_reference_groups_omitted_by_display_cap (mock_profile_result ):
291+ """SPEC section 7: every report surface that truncates a group list must
292+ state how many groups were omitted. The reference sub-table used to be
293+ silently capped at DISPLAY_GROUPS with no notice."""
294+ mock_profile_result ["dimensions" ][0 ]["reference" ] = {
295+ "deviation" : 0.1 ,
296+ "groups" : [
297+ {"label" : f"Group { i } " , "expected" : 1 / 15 , "actual" : 1 / 15 , "delta" : 0.0 }
298+ for i in range (15 )
299+ ],
300+ }
301+
302+ out = to_terminal (mock_profile_result )
303+
304+ assert "Group 11" in out
305+ assert "Group 12" not in out
306+ assert "… and 3 more groups" in out
307+
308+
271309def test_to_terminal_renders_flags_section (mock_profile_result ):
272310 out = to_terminal (mock_profile_result )
273311
0 commit comments