import { describe, expect, it } from "vitest"; import { createPdfByteStore } from "./byte-store"; import { markdownSourceToViewerHtml, resolveDomViewerHtml } from "./view-html"; import { ingestHtmlFromFile } from "./upload"; const HTML = `

Hello HTML viewer

`; describe("resolveDomViewerHtml", () => { it("returns sanitized HTML for html-dom representations", async () => { const store = createPdfByteStore(); const file = new File([HTML], "sample.html", { type: "text/html" }); const { document, representation } = await ingestHtmlFromFile(file, store); const html = resolveDomViewerHtml(document, representation, store); expect(html).toContain("Hello HTML viewer"); expect(html).not.toMatch(/