diff --git i/plugins/github/components/markdown-lite.test.tsx w/plugins/github/components/markdown-lite.test.tsx index ab714de86e..3e65cb4792 100644 --- i/plugins/github/components/markdown-lite.test.tsx +++ w/plugins/github/components/markdown-lite.test.tsx @@ -81,4 +81,23 @@ After the table.`} expect(slot.navigateCalls).toEqual([]); slot.unmount(); }); + + it("offers an image link when an attachment cannot load", () => { + const slot = renderSlot( + { + component: () => ( + + ), + }, + {}, + ); + + const image = slot.container.querySelector("img"); + expect(image).not.toBeNull(); + image?.dispatchEvent(new Event("error")); + expect( + slot.getByRole("link", { name: "Attachment preview" }).getAttribute("href"), + ).toBe("https://example.invalid/attachment.png"); + slot.unmount(); + }); });