Your lightweight open-source personal agent.
Python agent-frameworkai-agentai-agentschatbotchatopsdiscord-botllm-agentsllmslocal-llmmcpmodel-context-protocolmulti-agentopenai-compatibleopenclawpersonal-ai-assistantpythonself-hostedtelegram-bot-ai-assistantwebuiworkflow-automation
test(webui): assert code block language fallback
Xubin Ren15c6abc9919a
diff --git a/webui/src/tests/code-block.test.tsx b/webui/src/tests/code-block.test.tsxindex 4347354d7..94f2c4832 100644--- a/webui/src/tests/code-block.test.tsx+++ b/webui/src/tests/code-block.test.tsx@@ -12,13 +12,16 @@ const mockedStyles = vi.hoisted(() => ({vi.mock("react-syntax-highlighter/dist/esm/prism-async-light", () => ({default: ({children,+ language,style,}: {children: string;+ language?: string;style: Record<string, unknown>;}) => (<predata-testid="highlighted-code"+ data-language={language}data-theme={style === mockedStyles.dark ? "dark" : "light"}><code>{children}</code>@@ -61,6 +64,7 @@ describe("CodeBlock", () => {});expect(screen.getByTestId("highlighted-code")).toBeInTheDocument();+ expect(screen.getByTestId("highlighted-code")).toHaveAttribute("data-language", "text");expect(screen.getByText("const value = 1;")).toBeInTheDocument();});diff --git a/webui/src/tests/markdown-text-renderer.test.tsx b/webui/src/tests/markdown-text-renderer.test.tsxindex 2eb9488f5..b0282b756 100644--- a/webui/src/tests/markdown-text-renderer.test.tsx+++ b/webui/src/tests/markdown-text-renderer.test.tsx@@ -24,6 +24,7 @@ describe("MarkdownTextRenderer", () => {);expect(screen.getByText("code without language")).toBeInTheDocument();+ expect(screen.getByText("text")).toBeInTheDocument();expect(container.querySelectorAll("pre")).toHaveLength(1);});