Files
owl/tests/blockdom/comment.test.ts
Géry Debongnie 22a79cdedd [REF] reorganize file structure
in order to separate compiler/ and runtime/ code
2022-05-31 14:00:01 +02:00

27 lines
694 B
TypeScript

import { comment, mount } from "../../src/runtime/blockdom";
import { makeTestFixture } from "./helpers";
//------------------------------------------------------------------------------
// Setup and helpers
//------------------------------------------------------------------------------
let fixture: HTMLElement;
beforeEach(() => {
fixture = makeTestFixture();
});
afterEach(() => {
fixture.remove();
});
test("simple comment node", async () => {
const tree = comment("foo");
expect(tree.el).toBe(undefined);
mount(tree, fixture);
expect(fixture.innerHTML).toBe("<!--foo-->");
expect(tree.el).not.toBe(undefined);
tree.remove();
expect(fixture.innerHTML).toBe("");
});