Capgemini / dcx-react-library

React Library UI/UX agnostic
https://main--6069a6f47f4b9f002171f8e1.chromatic.com
MIT License
113 stars 6 forks source link

Fix/fix random failure test #673

Closed SidG-CG closed 3 months ago

SidG-CG commented 3 months ago

Test failure: image

After fix: image image

The issue was happening due to race condition between the onClick handler (which set the isLoading (disabled) status to false after 1000 ms) and the waitFor method (which also have a default timeout of 1000ms). Instead of increasing the waitFor timeout for all of the use cases, I have decreased the onClick handler's timeout to 900ms.