Stabilize virtualized timeline bottom pinning

This commit is contained in:
klopez4212
2026-06-30 13:55:16 +01:00
parent 354b1b8f59
commit 9c2f9a99e3
+16 -1
View File
@@ -167,6 +167,22 @@ test("reconnect backfills more missed channel messages than the live subscriptio
seenBeforeDisconnect,
);
const timeline = page.getByTestId("message-timeline");
await expect
.poll(async () => {
return timeline.evaluate((element) => {
const scrollable = element as HTMLDivElement;
scrollable.scrollTop = scrollable.scrollHeight;
scrollable.dispatchEvent(new Event("scroll", { bubbles: true }));
return (
scrollable.scrollHeight -
scrollable.clientHeight -
scrollable.scrollTop
);
});
})
.toBeLessThan(8);
await disconnectMockWebsockets(page);
const missedMessages = Array.from({ length: 260 }, (_, index) => ({
@@ -177,7 +193,6 @@ test("reconnect backfills more missed channel messages than the live subscriptio
// The newest backfilled message renders at the bottom once the reconnect
// catch-up settles.
const timeline = page.getByTestId("message-timeline");
await expect(timeline).toContainText("reconnect e2e missed 260", {
timeout: 15_000,
});