import { html, mount, patch, text } from "../../src/blockdom"; import { makeTestFixture } from "./helpers"; //------------------------------------------------------------------------------ // Setup and helpers //------------------------------------------------------------------------------ let fixture: HTMLElement; beforeEach(() => { fixture = makeTestFixture(); }); afterEach(() => { fixture.remove(); }); //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ describe("html block", () => { test("can be mounted and patched", async () => { const tree = html("12"); mount(tree, fixture); expect(fixture.innerHTML).toBe("12"); patch(tree, html("
a
") as any), fixture); expect(fixture.textContent).toBe("a
"); }); test("html vnode can represent