[FIX] qweb: allow t-if with t-call directives

closes #246
This commit is contained in:
Géry Debongnie
2019-07-16 13:17:51 +02:00
parent 5382e824b1
commit b1d022b583
3 changed files with 27 additions and 0 deletions
+7
View File
@@ -501,6 +501,13 @@ describe("t-call (template calling", () => {
expect(renderToString(qweb, "caller")).toBe(expected);
});
test("t-call with t-if", () => {
qweb.addTemplate("sub", "<span>ok</span>");
qweb.addTemplate("caller", '<div><t t-if="flag" t-call="sub"/></div>');
const expected = "<div><span>ok</span></div>";
expect(renderToString(qweb, "caller", {flag: true})).toBe(expected);
});
test("t-call not allowed on a non t node", () => {
qweb.addTemplate("_basic-callee", "<t>ok</t>");
qweb.addTemplate("caller", '<div t-call="_basic-callee"/>');