make t-set works with t-props

test by aku, fix by ged
This commit is contained in:
Alexandre Kühn
2019-03-15 10:11:50 +01:00
committed by Géry Debongnie
parent 733d5f81e6
commit 9be0b65cd3
2 changed files with 27 additions and 3 deletions
+21
View File
@@ -787,6 +787,27 @@ describe("props evaluation (with t-props directive)", () => {
await widget.mount(fixture);
expect(fixture.innerHTML).toBe("<div><span>hello aaron</span></div>");
});
test("t-set works with t-props", async () => {
class Parent extends Widget {
inlineTemplate = `
<div>
<t t-set="val" t-value="42"/>
<t t-widget="child" t-props="{val:val}"/>
</div>`;
widgets = { child: Child }
}
class Child extends Widget {
inlineTemplate = `
<span>
<t t-esc="props.val"/>
</span>`;
}
const widget = new Parent(env);
await widget.mount(fixture);
expect(normalize(fixture.innerHTML)).toBe("<div><span>42</span></div>");
});
});
describe("other directives with t-widget", () => {