-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[code-infra] Remove userEvent
export from @mui/internal-test-utils
#43313
[code-infra] Remove userEvent
export from @mui/internal-test-utils
#43313
Conversation
Netlify deploy previewhttps://deploy-preview-43313--material-ui.netlify.app/ Bundle size report |
…-library` eslint plugin
I've explored the option of using solely the |
🤔 doesn't it only return a promise when called with an async function? In any case, I'd rather make those methods async and keep the |
|
Would it make sense to just move these functions to X and remove them here? I don't see why we would use them over |
Great observation. 💯 |
@mui/internal-test-utils/userEvent
userEvent
export from @mui/internal-test-utils
userEvent.mousePress
oruserEvent.keyPress
do not seem to be used in this repo.mui-x
is using those extensively and never in an environment where React < 18.The existing function has an inconsistent return type (act returns a Promise).
Also renameduserEvent
export tofireUserEvent
to avoid the confusion with@testing/library/user-event
and in turn errors produced by theeslint-plugin-testing-library
whenuserEvent
calls are detected (plugin assumes they are from@testing-library/user-event
and complains if they are notawait
ed).Based on #43313 (comment) decided to remove the
userEvent
export.