import { describe, it, expect } from "vitest"; import { processPartialHtml, extractCompleteStyles, } from "../processPartialHtml"; describe("processPartialHtml", () => { it("returns empty string for empty input", () => { expect(processPartialHtml("")).toBe(""); }); it("strips incomplete tag at end", () => { expect(processPartialHtml('
HelloHello"); }); it("strips complete

World

"; expect(processPartialHtml(input)).toBe("
Hello

World

"); }); it("strips complete

World

'; expect(processPartialHtml(input)).toBe("
Hello

World

"); }); it("strips incomplete
Hello

World

Hello

World

"); }); it("handles body content with incomplete style at end", () => { const input = "
Content

World

"; expect(extractCompleteStyles(input)).toBe( "", ); }); it("extracts multiple complete style blocks", () => { const input = "
X
"; expect(extractCompleteStyles(input)).toBe( "", ); }); it("ignores incomplete style blocks", () => { const input = ""); }); it("extracts styles from head", () => { const input = "

Hi

"; expect(extractCompleteStyles(input)).toBe( "", ); }); });