@@ -507,10 +507,17 @@ def test_should_warn_when_wrapped_text_exceeds_declared_width(self):
507507 assert finding .bbox .x == 10
508508 assert finding .bbox .width > 50
509509 assert finding .bbox .x + finding .bbox .width <= 400
510- assert finding .measured ["text_bbox" ] == finding .bbox .model_dump ()
511- assert finding .measured ["clipped_by" ] == "max_width"
512- assert finding .measured ["max_width" ] == 50
513- assert finding .measured ["overflow_width" ] == finding .bbox .width - 50
510+ assert finding .measured == {
511+ "text_bbox" : finding .bbox .model_dump (),
512+ "wrapped_line_count" : 2 ,
513+ "max_width" : 50 ,
514+ "text_width" : finding .bbox .width ,
515+ "text_height" : finding .bbox .height ,
516+ "canvas_width" : 400 ,
517+ "canvas_height" : 300 ,
518+ "clipped_by" : "max_width" ,
519+ "overflow_width" : finding .bbox .width - 50 ,
520+ }
514521
515522 def test_should_warn_when_overflowing_word_also_extends_past_canvas_vertically (self ):
516523 """Text overflow does not suppress vertical text-clipped canvas diagnostics"""
@@ -535,10 +542,17 @@ def test_should_warn_when_overflowing_word_also_extends_past_canvas_vertically(s
535542 # then
536543 assert [d .code for d in diagnostics ] == ["text-overflow" , "text-clipped" , "off-canvas" ]
537544 finding = diagnostics [1 ]
538- assert finding .measured ["clipped_by" ] == "canvas"
539545 assert finding .bbox is not None
540- assert finding .measured ["overflow" ] == {
541- "bottom" : finding .bbox .y + finding .bbox .height - 300
546+ assert finding .measured == {
547+ "text_bbox" : finding .bbox .model_dump (),
548+ "wrapped_line_count" : 2 ,
549+ "max_width" : 50 ,
550+ "text_width" : finding .bbox .width ,
551+ "text_height" : finding .bbox .height ,
552+ "canvas_width" : 400 ,
553+ "canvas_height" : 300 ,
554+ "clipped_by" : "canvas" ,
555+ "overflow" : {"bottom" : finding .bbox .y + finding .bbox .height - 300 },
542556 }
543557
544558 def test_should_warn_when_default_font_renders_missing_glyph (self , monkeypatch ):
0 commit comments