The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 17:15 UTC
test(web): code block highlight test waits for the highlighter, not a 1s poll (#36269)
Julius Marminge committed
Nov 13, 2026 at 10:45 UTC
065aca4889fb422c536bbf673d2f2beba50df3cb
1 file changed
+3
apps/web/src/components/ChatMarkdown.browser.test.tsx
+3
@@ -12,6 +12,7 @@ import { useRightPanelStore } from "../rightPanelStore";
12
import { remarkEnableOrderedListNumbers } from "@t3tools/shared/markdownPipeline";
13
import { setMarkdownTaskChecked } from "@t3tools/shared/markdownTaskList";
14
import { HostImageUrlContext } from "./chat/hostImageUrl";
15
+import { getSyntaxHighlighterPromise } from "~/lib/syntaxHighlighting";
16
17
const { workspaceSearch, filesystemMetadata } = vi.hoisted(() => ({
18
workspaceSearch: vi.fn(),
@@ -283,6 +284,8 @@ it("highlights a code block's own source when an earlier block of the same lengt
284
// These two lines share a 32-bit FNV-1a hash and a length.
285
const first = 'const commitSha = "f36a6d8fe0aa";';
286
const second = 'const commitSha = "cb06f8d135b3";';
287
+ // The block suspends until the shared highlighter loads, which can outlast vi.waitFor on a busy runner.
288
+ await getSyntaxHighlighterPromise("ts");
289
{
290
await using screen = await renderText(`\`\`\`ts\n${first}\n\`\`\``);
291
await vi.waitFor(() => expect(highlightedText(screen.container)).toBe(first));