/** @odoo-module **/ import { KanbanCompiler } from "@web/views/kanban/kanban_compiler"; import { registry } from "@web/core/registry"; import { makeFakeLocalizationService } from "@web/../tests/helpers/mock_services"; function compileTemplate(arch) { const parser = new DOMParser(); const xml = parser.parseFromString(arch, "text/xml"); const compiler = new KanbanCompiler({ kanban: xml.documentElement }); return compiler.compile("kanban").outerHTML; } function assertTemplatesEqual(template1, template2) { if (template1.replace(/\s/g, "") === template2.replace(/\s/g, "")) { QUnit.assert.ok(true); } else { QUnit.assert.strictEqual(template1, template2); } } QUnit.module("Kanban Compiler", (hooks) => { hooks.beforeEach(() => { // compiler generates a piece of template for the translate alert in multilang registry.category("services").add("localization", makeFakeLocalizationService()); }); QUnit.test("bootstrap dropdowns with kanban_ignore_dropdown class should be left as is", async () => { const arch = `
`; const expected = `
`; assertTemplatesEqual(compileTemplate(arch), expected); }); });