import { QWeb } from "../../src/qweb/index"; import { renderToString } from "../helpers"; //------------------------------------------------------------------------------ // Setup and helpers //------------------------------------------------------------------------------ function render(template, context = {}) { const qweb = new QWeb(); qweb.addTemplate("test", template); return renderToString(qweb, "test", context); } //------------------------------------------------------------------------------ // Tests //------------------------------------------------------------------------------ describe("qweb t-att", () => { test("t-att-class with multiple classes", () => { expect(render(`
`, { value: true })).toBe( '
' ); expect(render(`
`, { value: true })).toBe( '
' ); }); test("t-att-class with multiple classes, some of which are duplicate", () => { expect(render(`
`, { value: true })).toBe( '
' ); expect( render(`
`, { value: false }) ).toBe('
'); }); });