Files
odoo_source/addons/web/static/tests/webclient
Aaron Bohy 5bd6dcd944 [FIX] web: tests: fix SwitchCompanyMenu tests failing randomly
Before this commit, some tests of the SwitchCompanyMenu sometimes
failed:
   - "companies can be logged in even if some toggled within delay"
   - "can toggle multiple companies at once"

They failed because the debounce delay between the first click to
toggle a company and the moment the company service is notified to
actually select the companies was sometimes too short for the 2 or
3 clicks on the menu to toggle companies to occur, as those clicks
are separated by nextTick(), i.e. a mix of calls to setTimeout and
requestAnimationFrame.

In tests, we patch the debounce delay to 0 by default, and before
this commit we set a delay of 50 in the two faulty tests. This
commit fixes the issue by keeping the real delay in those tests (1s),
as they aim at testing the fact that the user has the time to do
multiple clicks before committing the company changes and reloading.

Fixes runbot error 29962

closes odoo/odoo#142904

X-original-commit: 2ec65691ac11cb4216d873dcab77a84e2c35ba17
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-11-21 23:24:00 +00:00
..