fix(webui): persist markdown video previews

This commit is contained in:
Xubin Ren
2026-05-29 17:26:58 +08:00
parent 57563b671f
commit a71e6a0ae8
5 changed files with 89 additions and 4 deletions
@@ -15,4 +15,14 @@ describe("MarkdownTextRenderer", () => {
);
expect(screen.getByText("Diagram")).toBeInTheDocument();
});
it("renders markdown videos as inline players", () => {
render(<MarkdownTextRenderer>![nanobot-intro.mp4](/api/media/sig/video)</MarkdownTextRenderer>);
const video = screen.getByLabelText("Video attachment: nanobot-intro.mp4");
expect(video.tagName).toBe("VIDEO");
expect(video).toHaveAttribute("src", "/api/media/sig/video");
expect(video).toHaveAttribute("controls");
expect(screen.queryByRole("img", { name: "nanobot-intro.mp4" })).not.toBeInTheDocument();
});
});