fix: if t-props is not defined, should fallback on {}

This commit is contained in:
Géry Debongnie
2019-03-28 17:35:08 +01:00
parent 04679a6d03
commit afc89e6f66
3 changed files with 63 additions and 1 deletions
+16
View File
@@ -939,6 +939,22 @@ describe("random stuff/miscellaneous", () => {
await widget.mount(fixture);
expect(env.qweb.templates.parent.toString()).toMatchSnapshot();
});
test("t-props should not be undefined (snapshotting)", async () => {
env.qweb.addTemplate("parent", `<div><t t-widget="child"/></div>`);
class Parent extends Widget {
inlineTemplate = "parent";
widgets = { child: Child };
}
class Child extends Widget {
inlineTemplate = `<span>abc</span>`;
}
const widget = new Parent(env);
await widget.mount(fixture);
expect(env.qweb.templates.parent.toString()).toMatchSnapshot();
});
});
describe("async rendering", () => {