Test: the card at rest overflows only a 260px window now
TestTidyCardFloats and TestTidyNarrowAndShortWindows hold the card to scrolling inside itself when the slide's options are taller than it. Since the layout became a row of pictures and two quiet rows, the card at rest is 178px and no longer overflows a 380px window; both tests now shorten it to 260px, where it does, and assert the same things there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+11
−11
internal/slidestest/browser_editor_tidy_test.go+11 −11
diff --git a/internal/slidestest/browser_editor_tidy_test.go b/internal/slidestest/browser_editor_tidy_test.go| index 6e69742..403d8ee 100644 |
| --- a/internal/slidestest/browser_editor_tidy_test.go |
| +++ b/internal/slidestest/browser_editor_tidy_test.go |
| @@ -860,12 +860,12 @@ func TestTidyCardFloats(t *testing.T) { |
| // deck, since it shows one thing at a time), in a window short enough |
| // that they are taller than the card, which scrolls inside itself; |
| // the page does not. Since the deck's options (Q2) and the list of |
| - // boxes (Q5) left the card, a 480px window no longer makes them |
| - // overflow; 380px does. |
| + // boxes (Q5) left the card, and its layout became a row of pictures |
| + // with two quiet rows (Q3), only a 260px window makes them overflow. |
| te.rig.Run(waitFor(`document.querySelector('[slides-editor]').dataset.inspect === 'slide'`)) |
| c = te.card() |
| if c.ScrollH <= c.ClientH { |
| - te.size(1280, 380) |
| + te.size(1280, 260) |
| c = te.card() |
| } |
| if c.ScrollH <= c.ClientH || (c.OverflowY != "auto" && c.OverflowY != "scroll") { |
| @@ -984,23 +984,23 @@ func TestTidyNarrowAndShortWindows(t *testing.T) { |
| } |
| } |
| - // Short enough that the slide's options overflow the card (380px: |
| - // since Q2 and Q5 took the deck's options and the list of boxes out |
| - // of the card, 480px is not). |
| - te.size(1280, 380) |
| + // Short enough that the slide's options overflow the card (260px: |
| + // since Q2, Q5 and Q3 took the deck's options, the list of boxes and |
| + // the layout's fields out of the card, 380px is not). |
| + te.size(1280, 260) |
| c := te.card() |
| if c.ScrollH <= c.ClientH || c.Card.B > c.Desk.B-12+0.5 { |
| - t.Errorf("1280x380: the card holds %.0fpx in %.0fpx and ends at %.1f (desk %.1f); want it to scroll inside itself, 12px short of the foot", c.ScrollH, c.ClientH, c.Card.B, c.Desk.B) |
| + t.Errorf("1280x260: the card holds %.0fpx in %.0fpx and ends at %.1f (desk %.1f); want it to scroll inside itself, 12px short of the foot", c.ScrollH, c.ClientH, c.Card.B, c.Desk.B) |
| } |
| var notes string |
| te.rig.Run(chromedp.Evaluate(`(b => b.scrollHeight > b.clientHeight && getComputedStyle(b).overflowY === 'auto' ? '' : 'the notes body ' + b.clientHeight + 'px tall holds ' + b.scrollHeight + 'px and does not scroll')(document.querySelector('[slides-notes-body]'))`, ¬es)) |
| if notes != "" { |
| - t.Errorf("1280x380: %s", notes) |
| + t.Errorf("1280x260: %s", notes) |
| } |
| if got := te.scrolls(t); got != "" { |
| - t.Errorf("1280x380: the page scrolls: %s", got) |
| + t.Errorf("1280x260: the page scrolls: %s", got) |
| } |
| - te.rig.Screen(`[slides-editor]`, "1280x380") |
| + te.rig.Screen(`[slides-editor]`, "1280x260") |
| } |
| // focusJS says where focus is: the element's description, whether it is |