- Add id, isAnyStreaming, onEdit, onRetry props to ChatMessageProps - User messages show edit Pencil on hover via ChatMessageActions - Edit pencil opens inline textarea with Save/Discard buttons - Save edit calls onEdit(id, newContent), disabled when textarea empty - Discard edit reverts to read-only bubble - Assistant messages show retry RefreshCw via ChatMessageActions - All edit/retry actions disabled when isAnyStreaming is true - Update test stubs to reflect new prop surface
20 lines
935 B
TypeScript
20 lines
935 B
TypeScript
// @vitest-environment jsdom
|
|
import { describe, it, expect } from "vitest";
|
|
|
|
describe("ChatMessage", () => {
|
|
it("exports ChatMessage component", async () => {
|
|
const mod = await import("./ChatMessage");
|
|
expect(mod.ChatMessage).toBeDefined();
|
|
});
|
|
|
|
it.todo("renders user message as right-aligned bubble with plain text");
|
|
it.todo("renders assistant message with ChatMarkdownMessage");
|
|
it.todo("renders ChatMessageIdentityBar for assistant messages when agentName is provided");
|
|
it.todo("shows edit pencil on hover for user messages");
|
|
it.todo("shows retry button on hover for assistant messages");
|
|
it.todo("hides retry button when isAnyStreaming is true");
|
|
it.todo("switches to inline edit textarea on pencil click");
|
|
it.todo("renders ChatStreamingCursor when isStreaming is true");
|
|
it.todo("Save edit button disabled when edit textarea is empty");
|
|
it.todo("Discard edit reverts to read-only bubble");
|
|
});
|