Skip to content
Source
Sign inSign up
pingdotgg/t3code

test(web): timeline restore test no longer flakes on a late live-follow save #22528

Closedtris203(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/22528/headopened View on GitHub

Showing 1 changed file with 4 additions and 4 deletions.

x
0 of 1 viewed, 1 left
4 additions and 4 deletionsapps/web/src/components/chat/MessagesTimeline.browser.test.tsxModified
View file
@@ -1504,15 +1504,17 @@
it("restores a manual reading position after reopening and switching threads", async () => {
const props = baseProps();
- function Chat() {
+ function Chat({ routeThreadKey = props.routeThreadKey }: { routeThreadKey?: string }) {
const [liveFollowEnabled, setLiveFollowEnabled] = useState(true);
// The chat view stops following the live edge when the reader scrolls.
return (
<div className="contents" onWheelCapture={() => setLiveFollowEnabled(false)}>
<MessagesTimeline
{...props}
+ routeThreadKey={routeThreadKey}
timelineEntries={tallEntries}
liveFollowEnabled={liveFollowEnabled}
+ onManualNavigation={() => setLiveFollowEnabled(false)}
</div>
@@ -1532,9 +1534,7 @@
scrollOffset: offset,
- const timeline = (routeThreadKey: string) => (
- <MessagesTimeline {...props} routeThreadKey={routeThreadKey} timelineEntries={tallEntries} />
- );
+ const timeline = (routeThreadKey: string) => <Chat routeThreadKey={routeThreadKey} />;
await using screen = await renderElement(timeline(props.routeThreadKey));
const reopenedViewport = await waitForList(props);