throw qweb error if invalid loop in t-foreach

This commit is contained in:
Géry Debongnie
2019-02-01 11:28:03 +01:00
parent d2d622b3c3
commit c46bad6e35
2 changed files with 11 additions and 0 deletions
+8
View File
@@ -545,6 +545,14 @@ describe("foreach", () => {
renderToString(qweb, "test", context);
expect(Object.keys(context).length).toBe(0);
});
test("throws error if invalid loop expression", () => {
qweb.addTemplate(
"test",
`<div><t t-foreach="abc" t-as="item"><span/></t></div>`
);
expect(() => qweb.render("test")).toThrow("Invalid loop expression");
});
});
describe("misc", () => {