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
12 changes: 8 additions & 4 deletions apps/web/src/components/ChatMarkdown.browser.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -830,10 +830,14 @@ describe("ChatMarkdown thread find", () => {
),
);
await frame();
const ranges = [...CSS.highlights.values()].flatMap((value) => [...value]);
expect(ranges.map((range) => (range as Range).toString())).toEqual(
Array.from({ length: count }, () => query),
);
// Lazy blocks such as Mermaid can swap their source text after the first frame,
// emptying a range for a moment, so wait for the highlights to settle.
await vi.waitFor(() => {
const ranges = [...CSS.highlights.values()].flatMap((value) => [...value]);
expect(ranges.map((range) => (range as Range).toString())).toEqual(
Array.from({ length: count }, () => query),
);
});
const segments =
searchableMessageSegments(
{ role: user ? "user" : "assistant", text, streaming: false },
Expand Down
Loading