test(ui): update home-relative media expectation

This commit is contained in:
Peter Steinberger
2026-05-02 22:29:56 +01:00
parent dc6d9973e9
commit cb9a97f211

View File

@@ -241,13 +241,23 @@ describe("message-normalizer", () => {
]);
});
it("does not fall back to raw text when an invalid MEDIA line is stripped", () => {
it("keeps home-relative MEDIA paths as assistant attachments", () => {
const result = normalizeMessage({
role: "assistant",
content: "MEDIA:~/Pictures/My File.png",
});
expect(result.content).toEqual([]);
expect(result.content).toEqual([
{
type: "attachment",
attachment: {
url: "~/Pictures/My File.png",
kind: "image",
label: "My File.png",
mimeType: "image/png",
},
},
]);
});
it("preserves relative MEDIA references as visible text instead of dropping the assistant turn", () => {