mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] blockdom: toString method in multi could crash
This commit is contained in:
committed by
Aaron Bohy
parent
281b32965e
commit
7711733a23
@@ -38,6 +38,19 @@ describe("t-set", () => {
|
||||
expect(renderToString(template)).toBe("ok");
|
||||
});
|
||||
|
||||
test("set from body literal (with t-if/t-else", () => {
|
||||
const template = `
|
||||
<t>
|
||||
<t t-set="value">
|
||||
<t t-if="condition">true</t>
|
||||
<t t-else="">false</t>
|
||||
</t>
|
||||
<t t-esc="value"/>
|
||||
</t>`;
|
||||
expect(renderToString(template, { condition: true })).toBe("true");
|
||||
expect(renderToString(template, { condition: false })).toBe("false");
|
||||
});
|
||||
|
||||
test("set from attribute lookup", () => {
|
||||
const template = `<div><t t-set="stuff" t-value="value"/><t t-esc="stuff"/></div>`;
|
||||
expect(renderToString(template, { value: "ok" })).toBe("<div>ok</div>");
|
||||
|
||||
Reference in New Issue
Block a user