diff --git a/ui/app/(prowler)/lighthouse/_components/chat/message-bubble.browser.test.tsx b/ui/app/(prowler)/lighthouse/_components/chat/message-bubble.browser.test.tsx new file mode 100644 index 0000000000..30d33d1b61 --- /dev/null +++ b/ui/app/(prowler)/lighthouse/_components/chat/message-bubble.browser.test.tsx @@ -0,0 +1,47 @@ +import { describe, expect, it } from "vitest"; + +import { render } from "@/__tests__/render-browser"; +import { + LIGHTHOUSE_V2_MESSAGE_ROLE, + LIGHTHOUSE_V2_PART_TYPE, + type LighthouseV2Message, +} from "@/app/(prowler)/lighthouse/_types"; + +import { MessageBubble } from "./message-bubble"; + +describe("MessageBubble", () => { + it("should wrap long user text inside the message bubble", async () => { + // Given + const longText = "a".repeat(500); + const userMessage: LighthouseV2Message = { + id: "message-user-long-text", + role: LIGHTHOUSE_V2_MESSAGE_ROLE.USER, + model: null, + tokenUsage: null, + insertedAt: "2026-06-25T10:00:00Z", + parts: [ + { + id: "part-user-long-text", + type: LIGHTHOUSE_V2_PART_TYPE.TEXT, + content: { text: longText }, + toolCallOutcome: null, + insertedAt: "2026-06-25T10:00:00Z", + updatedAt: "2026-06-25T10:00:00Z", + }, + ], + }; + + // When + const { getByText } = await render( +
{messageText}
+{messageText}
) : (