[IMP] app: add templates in app config

Also, improve the parsing code
This commit is contained in:
Géry Debongnie
2021-11-22 10:34:14 +01:00
committed by Lucas Perais - lpe@odoo
parent 536d9e1762
commit 4a4b1fbba5
3 changed files with 45 additions and 7 deletions
+6 -6
View File
@@ -21,12 +21,12 @@ describe("error handling", () => {
expect(() => context.addTemplate("test", "<div/>")).toThrow("already defined");
});
// test("addTemplates throw if parser error", () => {
// const context = new TestContext();
// expect(() => {
// context.addTemplates("<templates><abc>></templates>");
// }).toThrow("Invalid XML in template");
// });
test("addTemplates throw if parser error", () => {
const context = new TestContext();
expect(() => {
context.addTemplates("<templates><abc>></templates>");
}).toThrow("Invalid XML in template");
});
test("nice error when t-on is evaluated with a missing event", () => {
expect(() => renderToString(`<div t-on="somemethod"></div>`)).toThrow(