From 7fe6861a54cd143c228d64dff3ee0cc4730707a0 Mon Sep 17 00:00:00 2001 From: nesquena-hermes Date: Wed, 24 Jun 2026 10:15:04 +0000 Subject: [PATCH] test(#4702): thread _lastMessageClientHeight through the scroll-pin-reentry JS harness The #4295 harness runs the extracted scroll-handler body in a Node new Function(); the body now references _lastMessageClientHeight, so it must be a param + threaded through state (seeded null, samples keep clientHeight stable so grew stays false and the pin-reentry assertions are unchanged). --- tests/test_issue4295_scroll_pin_reentry.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_issue4295_scroll_pin_reentry.py b/tests/test_issue4295_scroll_pin_reentry.py index d1c5216e..8e3cc3eb 100644 --- a/tests/test_issue4295_scroll_pin_reentry.py +++ b/tests/test_issue4295_scroll_pin_reentry.py @@ -58,6 +58,7 @@ def _run_scroll_listener(samples: list[dict[str, int]]) -> dict[str, int | bool const step = new Function( 'el', '_lastScrollTop', + '_lastMessageClientHeight', '_nearBottomCount', '_scrollPinned', '_messageUserUnpinned', @@ -73,6 +74,7 @@ const step = new Function( payload.body + ` return { _lastScrollTop, + _lastMessageClientHeight, _nearBottomCount, _scrollPinned, _messageUserUnpinned, @@ -82,6 +84,7 @@ return { let state = { _lastScrollTop: 800, + _lastMessageClientHeight: null, _nearBottomCount: 0, _scrollPinned: true, _messageUserUnpinned: false, @@ -92,6 +95,7 @@ for (const sample of payload.samples) { state = step( sample, state._lastScrollTop, + state._lastMessageClientHeight, state._nearBottomCount, state._scrollPinned, state._messageUserUnpinned,