mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
make t-set works with t-props
test by aku, fix by ged
This commit is contained in:
committed by
Géry Debongnie
parent
733d5f81e6
commit
9be0b65cd3
@@ -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", () => {
|
||||
|
||||
Reference in New Issue
Block a user