In a normal flux, this happen when an option is hovered and left:
1) Hover event -> the widget goes in 'preview' state and notifies a
preview to the option
2) The preview is received by the option and, after an internal mutex
resolution, the option enables its methods with the widget values.
3) Leave event -> same as (1), except leaving 'preview' state
4) same as (2), except receiving a 'reset'
Everything is fine and correctly managed... except if a JS code triggers
both hover and leave events in the same execution... and this is what
tests are doing. In this case, as (2) executes after an internal mutex
resolution, the points (2) and (3) were inverted, so the widget left the
'preview' state before (2) got the widget values.
Maybe the test system has to be improved, but this commit solves the
problem for this case explicitely.
Part of https://github.com/odoo/odoo/pull/40282
In preparation of task-2122935 and other tasks