Skip to content

Commit 93e8412

Browse files
t3dotggclaude
andcommitted
test(web): cover late tool output while pinned to the end
Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent ca4fb41 commit 93e8412

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎apps/web/src/components/chat/MessagesTimeline.test.tsx‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,13 +718,21 @@ describe("MessagesTimeline", () => {
718718
);
719719
});
720720
const toggle = renderer!.root.findByProps({ "aria-expanded": false });
721+
const list = renderer!.root.find(
722+
(node) => node.props.ListFooterComponent !== undefined && node.props.onItemSizeChanged,
723+
);
721724
for (const scrollHeight of [1300, 900]) {
722725
await act(() => toggle.props.onClick());
723726
// The rows grow or shrink once the list measures them.
724727
viewport.scrollHeight = scrollHeight;
725728
await flushFrame();
726-
await flushFrame();
727729
expect(viewport.scrollTop).toBe(isAtEnd ? scrollHeight : 400);
730+
// Tool output that renders late is pinned before the next frame.
731+
viewport.scrollHeight = scrollHeight + 200;
732+
await act(() => list.props.onItemSizeChanged());
733+
expect(viewport.scrollTop).toBe(isAtEnd ? scrollHeight + 200 : 400);
734+
await flushFrame();
735+
await flushFrame();
728736
viewport.scrollTop = 400;
729737
}
730738
} finally {

0 commit comments

Comments
 (0)