Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/src/j5/sharing/sharedTimeline.browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,14 @@ describe("useSharedConversationEntries", () => {
seen.push(useSharedConversationEntries(threadRef, entries));
return <span>{props.tick}</span>;
}
// The message is first seen a millisecond before the thread is shared; on the wall clock both
// renders can fall in the same millisecond, which reads as seen once it may be shared.
using now = vi.spyOn(Date, "now").mockReturnValue(10);
// The hook reads no route.
await using screen = await render(<Probe tick={1} />, { router: false });
expect(authors.refresh).not.toHaveBeenCalled();
reach.people = twoWriters;
now.mockReturnValue(11);
await screen.rerender(<Probe tick={2} />);
expect(seen.at(-1)?.map((entry) => entry.id)).toEqual(["entry-1"]);
expect(authors.refresh).toHaveBeenCalledTimes(1);
Expand Down
Loading