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).
This commit is contained in:
nesquena-hermes committed 2026-06-24 10:15:04 +00:00
1 parent 671f4504ae
commit 7fe6861a54
1 file changed
+4
@@ -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,