import { describe, expect, it } from "vitest"; import { sanitizeHTML, stripHTML } from "../html"; describe("stripHTML", () => { it("removes tags and returns plain text", async () => { expect(await stripHTML("
hi there
")).toBe("hi there"); }); it("returns empty string for empty input", async () => { expect(await stripHTML("")).toBe(""); }); it("preserves text across multiple block elements", async () => { expect(await stripHTML("World
")).toBe("HelloWorld"); }); }); describe("sanitizeHTML", () => { it("strips event handler attributes and disallowed elements", async () => { const out = await sanitizeHTML('ok
'); expect(out).toContain("ok
"); expect(out).not.toContain("onclick"); expect(out).not.toContain("