Compare commits

..

1 Commits

Author SHA1 Message Date
Aaron Bohy b11a440625 issue render await 2023-07-06 21:13:33 +02:00
2 changed files with 45 additions and 3 deletions
+3 -3
View File
@@ -5594,9 +5594,9 @@
}
},
"tough-cookie": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.3.tgz",
"integrity": "sha512-aX/y5pVRkfRnfmuX+OdbSdXvPe6ieKX/G2s7e98f4poJHnqH3281gDPm/metm6E/WRamfx7WC4HUqkWHfQHprw==",
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.1.2.tgz",
"integrity": "sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==",
"dev": true,
"requires": {
"psl": "^1.1.33",
+42
View File
@@ -504,6 +504,48 @@ test("update a sub-component twice in the same frame", async () => {
]).toBeLogged();
});
test.only("abcde", async () => {
class Parent extends Component {
static template = xml`<span t-esc="state.x"/>`;
state = useState({ x: 1 });
setup() {
useLogLifecycle();
}
async _doIt() {
await Promise.resolve();
this.state.x++;
}
async doIt() {
await this._doIt();
this.state.x++;
}
}
const parent = await mount(Parent, fixture);
expect([
"Parent:setup",
"Parent:willStart",
"Parent:willRender",
"Parent:rendered",
"Parent:mounted",
]).toBeLogged();
expect(fixture.innerHTML).toBe("<span>1</span>");
parent.doIt();
await nextTick();
expect([
"Parent:willRender",
"Parent:rendered",
"Parent:willRender",
"Parent:rendered",
"Parent:willPatch",
"Parent:patched",
]).toBeLogged();
expect(fixture.innerHTML).toBe("<span>3</span>");
});
test("update a sub-component twice in the same frame, 2", async () => {
class ChildA extends Component {
static template = xml`<span><t t-esc="val()"/></span>`;