import { describe, expect, it } from "vitest"; import { unwrapTemplate } from "./htmlTemplate.js"; describe("unwrapTemplate", () => { it("returns the input unchanged when there is no template wrapper", () => { const html = `
hello
`; expect(unwrapTemplate(html)).toBe(html); }); it("unwraps a bare top-level template fragment", () => { const inner = `hi`; const html = ``; expect(unwrapTemplate(html)).toBe(inner); }); it("unwraps a full document whose body only contains a template", () => { const inner = `
`; const html = ``; expect(unwrapTemplate(html)).toBe(inner); }); it("returns the input unchanged when the closing template tag is missing", () => { const html = `