[REF] component: improve render method

This commit is contained in:
Géry Debongnie
2019-08-23 22:22:34 +02:00
parent 34e463ad0a
commit 9843d16585
4 changed files with 24 additions and 11 deletions
+8
View File
@@ -327,9 +327,17 @@ describe("default props", () => {
class TestWidget extends Widget {
static defaultProps = { p: 4 };
}
env.qweb.addTemplates(`
<templates>
<div t-name="TestWidget"><t t-esc="props.p"/></div>
</templates>`);
const w = new TestWidget(env, { p: 1 });
await w.mount(fixture);
expect(fixture.innerHTML).toMatchSnapshot();
await w.__updateProps({});
await w.render();
expect(w.props.p).toBe(4);
expect(fixture.innerHTML).toMatchSnapshot();
});
});