import { describe, expect, test } from "@odoo/hoot"; import { patchWithCleanup } from "@web/../tests/web_test_helpers"; import { createElement } from "@web/core/utils/xml"; import { FormCompiler } from "@web/views/form/form_compiler"; describe.current.tags("headless"); function compileTemplate(arch) { const parser = new DOMParser(); const xml = parser.parseFromString(arch, "text/xml"); const compiler = new FormCompiler({ form: xml.documentElement }); return compiler.compile("form"); } test("properly compile simple div", () => { const arch = /*xml*/ `
lol
`; const expected = /*xml*/ `
lol
`; expect(compileTemplate(arch)).toHaveOuterHTML(expected); }); test("label with empty string compiles to FormLabel with empty string", () => { const arch = /*xml*/ `