test(ui): update home-relative media expectation · openclaw/openclaw@cb9a97f
steipete
·
2026-05-03
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -241,13 +241,23 @@ describe("message-normalizer", () => {
|
241 | 241 | ]); |
242 | 242 | }); |
243 | 243 | |
244 | | -it("does not fall back to raw text when an invalid MEDIA line is stripped", () => { |
| 244 | +it("keeps home-relative MEDIA paths as assistant attachments", () => { |
245 | 245 | const result = normalizeMessage({ |
246 | 246 | role: "assistant", |
247 | 247 | content: "MEDIA:~/Pictures/My File.png", |
248 | 248 | }); |
249 | 249 | |
250 | | -expect(result.content).toEqual([]); |
| 250 | +expect(result.content).toEqual([ |
| 251 | +{ |
| 252 | +type: "attachment", |
| 253 | +attachment: { |
| 254 | +url: "~/Pictures/My File.png", |
| 255 | +kind: "image", |
| 256 | +label: "My File.png", |
| 257 | +mimeType: "image/png", |
| 258 | +}, |
| 259 | +}, |
| 260 | +]); |
251 | 261 | }); |
252 | 262 | |
253 | 263 | it("preserves relative MEDIA references as visible text instead of dropping the assistant turn", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。