mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: t-set with a body should not be joined with comma
closes #574
This commit is contained in:
+21
-5
@@ -154,24 +154,28 @@ describe("t-esc", () => {
|
||||
});
|
||||
|
||||
test("div with falsy values", () => {
|
||||
qweb.addTemplate("test", `
|
||||
qweb.addTemplate(
|
||||
"test",
|
||||
`
|
||||
<div>
|
||||
<p t-esc="v1"/>
|
||||
<p t-esc="v2"/>
|
||||
<p t-esc="v3"/>
|
||||
<p t-esc="v4"/>
|
||||
<p t-esc="v5"/>
|
||||
</div>`);
|
||||
</div>`
|
||||
);
|
||||
const vals = {
|
||||
v1: false,
|
||||
v2: undefined,
|
||||
v3: null,
|
||||
v4: 0,
|
||||
v5: ""
|
||||
}
|
||||
expect(renderToString(qweb, "test", vals)).toBe("<div><p>false</p><p></p><p></p><p>0</p><p></p></div>");
|
||||
};
|
||||
expect(renderToString(qweb, "test", vals)).toBe(
|
||||
"<div><p>false</p><p></p><p></p><p>0</p><p></p></div>"
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("t-raw", () => {
|
||||
@@ -278,6 +282,18 @@ describe("t-set", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("t-set with content and sub t-esc", () => {
|
||||
qweb.addTemplate(
|
||||
"test",
|
||||
`<div>
|
||||
<t t-set="setvar"><t t-esc="beep"/> boop</t>
|
||||
<t t-esc="setvar"/>
|
||||
</div>`
|
||||
);
|
||||
|
||||
expect(renderToString(qweb, "test", { beep: "beep" })).toBe("<div>beep boop</div>");
|
||||
});
|
||||
|
||||
test("evaluate value expression, part 2", () => {
|
||||
qweb.addTemplate(
|
||||
"test",
|
||||
|
||||
Reference in New Issue
Block a user