[FIX] compiler: allow t-if with empty content

This commit is contained in:
Géry Debongnie
2021-12-01 13:16:32 +01:00
committed by Samuel Degueldre
parent e2fedc6eff
commit e008966291
4 changed files with 37 additions and 4 deletions
+13
View File
@@ -395,6 +395,19 @@ describe("qweb parser", () => {
});
});
test("t-if with empty content", async () => {
expect(parse(`<t t-if="condition"></t>`)).toEqual({
type: ASTType.TIf,
condition: "condition",
content: {
type: ASTType.Text,
value: "",
},
tElif: null,
tElse: null,
});
});
test("t-if (on dom node", async () => {
expect(parse(`<div t-if="condition">hey</div>`)).toEqual({
type: ASTType.TIf,