Skip to content

Commit fb73742

Browse files
committed
[FIX] web: HOOT: undeterministic tests (switch company menu)
In the "router" there are some debounced methods, and they produce some undeterministic errors. To avoid these errors, we run all timers before reading value from the router. task-3705027 runbot-error-59015 runbot-error-58156 closes odoo#158471 X-original-commit: e0f3586 Signed-off-by: Aaron Bohy (aab) <[email protected]> Signed-off-by: Romeo Fragomeli (rfr) <[email protected]>
1 parent 8d15e50 commit fb73742

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

addons/web/static/tests/webclient/mobile/mobile_switch_company.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ test("single company selected: toggling it off will keep it", async () => {
140140
* [ ] Company 2
141141
* [ ] Company 3
142142
*/
143+
await runAllTimers();
143144
expect(router.current).toEqual({ cids: 1 });
144145
expect(getService("company").activeCompanyIds).toEqual([1]);
145146
expect(getService("company").currentCompany.id).toBe(1);

addons/web/static/tests/webclient/switch_company_menu.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ test("single company selected: toggling it off will keep it", async () => {
179179
* [ ] Hercules
180180
* [ ] Hulk
181181
*/
182+
await runAllTimers();
182183
expect(router.current).toEqual({ cids: 3 });
183184
expect(getService("company").activeCompanyIds).toEqual([3]);
184185
expect(getService("company").currentCompany.id).toBe(3);

0 commit comments

Comments
 (0)