diff --git a/ui/litellm-dashboard/src/components/playground/chat_ui/ChatMessageBubble.test.tsx b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatMessageBubble.test.tsx new file mode 100644 index 00000000000..70c3fdd4f29 --- /dev/null +++ b/ui/litellm-dashboard/src/components/playground/chat_ui/ChatMessageBubble.test.tsx @@ -0,0 +1,296 @@ +import { render, screen } from "@testing-library/react"; +import { describe, it, expect, vi } from "vitest"; +import ChatMessageBubble from "./ChatMessageBubble"; +import { EndpointType } from "./mode_endpoint_mapping"; +import { MessageType } from "./types"; + +// Mock child components to isolate bubble rendering logic +vi.mock("react-markdown", () => ({ + default: ({ children }: { children: string }) =>
{children},
+}));
+
+vi.mock("react-syntax-highlighter/dist/esm/styles/prism", () => ({
+ coy: {},
+}));
+
+vi.mock("./ReasoningContent", () => ({
+ default: ({ reasoningContent }: { reasoningContent: string }) => (
+
+ {children}
+
+ );
+ },
+ pre: ({ node, ...props }) => (
+
+ ),
+ }}
+ >
+ {typeof message.content === "string" ? message.content : ""}
+
- {children}
-
- );
- },
- pre: ({ node, ...props }) => (
-
- ),
- }}
- >
- {typeof message.content === "string" ? message.content : ""}
-