diff options
Diffstat (limited to 'packages/meshbay-hub/tests/test_layout_responsive.py')
| -rw-r--r-- | packages/meshbay-hub/tests/test_layout_responsive.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/packages/meshbay-hub/tests/test_layout_responsive.py b/packages/meshbay-hub/tests/test_layout_responsive.py index d7a680d..4ee07d0 100644 --- a/packages/meshbay-hub/tests/test_layout_responsive.py +++ b/packages/meshbay-hub/tests/test_layout_responsive.py @@ -145,12 +145,19 @@ def test_the_measurement_survives_a_scrolled_page(app): def test_the_panel_refits_when_the_viewport_changes(app): - # `fit` is wrapped by `fitAndPin` (which also keeps the view pinned to - # the bottom on a resize) — that is what the listeners bind to. + # `fit` is wrapped by `fitAndPin` (which also keeps the view pinned to the + # bottom on a resize), and on the window by `refit`, which additionally + # forgets the learnt space below the panel — a real viewport change can + # mean the page under it reflowed. `visualViewport` deliberately does not + # forget: a phone fires that event constantly, and re-deriving the leftover + # there is what made fit() oscillate and weld the reader to the bottom of + # the conversation (see test_chat_scroll_up.py). for event in ("resize", "orientationchange"): - assert f"addEventListener('{event}', fitAndPin)" in app + assert f"addEventListener('{event}', refit)" in app assert "visualViewport?.addEventListener('resize', fitAndPin)" in app - assert "removeEventListener('resize', fitAndPin)" in app, "the listener must be released" + assert "removeEventListener('resize', refit)" in app, "the listener must be released" + assert "el._chatFitBelow = 0" in app, ( + "a window resize must forget the learnt leftover and measure it again") def test_the_css_floor_does_not_fight_the_measurement(css, app): |