Before this commit, several qunit load state tests sometimes
failed. They all follow the same pattern:
- trigger an "hashchange" event to simulate an update of the url
- wait twice for nextTick
- check the DOM reflects the url change
However, waiting for 2 ticks isn't enough. Indeed, when the url
hash is set, our mock location object dispatches a "real" hashchange
event on window, but it does it after a setTimeout [1]. Then, the
webclient is notified (via the router service) of the url change,
and reacts by loading the appropriate action. This then requires
2 ticks, because we first clear the DOM with the BlankComponent,
and then we mount the requested action/view.
This commit makes those tests more robust by waiting for a
setTimeout before the 2 nextTicks.
[1] https://github.com/odoo/odoo/blob/1882d8f89f760bd1ff8a2bf0ae798939402647a3/addons/web/static/tests/setup.js#L52
Runbot issue~37030
closesodoo/odoo#162939
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>