mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] component tests: make them work on windows
For an unknown reason, it looks like the way ticks, micro task ticks or other subtle scheduling issues are different on a windows machine (it may be because of other difference, such as a specific version of nodejs). Anyway, I could not find the cause of the issue, but simply waiting an extra microtask tick seems to work.
This commit is contained in:
@@ -2683,12 +2683,19 @@ describe("async rendering", () => {
|
||||
await nextMicroTick();
|
||||
expect(steps).toEqual(["render"]);
|
||||
await nextMicroTick();
|
||||
// For an unknown reason, this test fails on windows without the next microtick. It works
|
||||
// in linux and osx, but fails on at least this machine.
|
||||
// I do not see anything harmful in waiting an extra tick. But it is annoying to not
|
||||
// know what is different.
|
||||
await nextMicroTick();
|
||||
expect(steps).toEqual(["render", "render"]);
|
||||
expect(fixture.innerHTML).toBe("<div><span>1</span></div>");
|
||||
parent.state.valA = 3;
|
||||
await nextMicroTick();
|
||||
expect(steps).toEqual(["render", "render"]);
|
||||
await nextMicroTick();
|
||||
// same as above
|
||||
await nextMicroTick();
|
||||
expect(steps).toEqual(["render", "render", "render"]);
|
||||
expect(fixture.innerHTML).toBe("<div><span>1</span></div>");
|
||||
await nextTick();
|
||||
|
||||
Reference in New Issue
Block a user