mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] component: mount: remove renderBeforeRemount option
Re-render the component all the time before remounting it, which seems safer anyway. In the test, we had to add a nextTick to wait for the changes to be notified (before, we waited thanks to the additional call to mount). If we don't do the nextTick, mount is called, and render is called right after (before the promise returned by mount is resolved). This scenario doesn't work right now (see #441). Closes #381
This commit is contained in:
committed by
Géry Debongnie
parent
5731358607
commit
af4f372506
@@ -4911,10 +4911,8 @@ describe("unmounting and remounting", () => {
|
||||
expect(fixture.innerHTML).toBe("<div>1</div>");
|
||||
widget.unmount();
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
await nextTick(); // wait for changes to be detected before remounting
|
||||
await widget.mount(fixture);
|
||||
expect(fixture.innerHTML).toBe("<div>1</div>");
|
||||
widget.unmount();
|
||||
await widget.mount(fixture, true);
|
||||
expect(fixture.innerHTML).toBe("<div>3</div>");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user