[test] Refactor most Pickers test to async#14583
[test] Refactor most Pickers test to async#14583LukasTy wants to merge 25 commits intomui:masterfrom
Conversation
|
Deploy preview: https://deploy-preview-14583--material-ui-x.netlify.app/ |
docs/next-env.d.ts
Outdated
|
|
||
| // NOTE: This file should not be edited | ||
| // see https://nextjs.org/docs/basic-features/typescript for more information. | ||
| // see https://nextjs.org/docs/pages/building-your-application/configuring/typescript for more information. |
There was a problem hiding this comment.
This is generated after running pnpm start
packages/x-data-grid-premium/src/tests/rowGrouping.DataGridPremium.test.tsx
Outdated
Show resolved
Hide resolved
|
Btw, while working on #14508 I noticed there are two instances that makes the tests somewhat unstable, these |
cherniavskii
left a comment
There was a problem hiding this comment.
I don't understand how this works, but I don't want to block this PR if it reduces the flakiness 😅
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
|
I'm parking this PR until we move away from Hopefully, #14927 can reduce the existing |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
I suspect that the fake clock configuration might be leaking outside the intended scope and producing flaky unit tests (i.e. 1, 2, 3).
This PR aims to ensure that the timers mocking is reset after each describe block.After more testing I concluded that manual clock restoring doesn't help at all as everything is already done.
I'm exploring the next best thing—avoid faking clock whenever possible and where needed, ensure that only
Dateis mocked to prevent running into cases where faked timeouts are bleeding into an async test.The current solution in a nutshell:
@testing-library/user-eventto Pickers and test packages dependencies to avoid the need of passingclickandkeyboardfunction down to utility functionsBut we are already bringing in this dependency in
test/performance-chartspackage... 🤷clock: 'fake'whenever possibleuserEvent.clickanduserEvent.keyboardinstead of the syncfireEventutility