Repository navigation
[code-infra] Remove deprecated data-mui-test in favour of data-testid - #14882
Conversation
|
Deploy preview: https://deploy-preview-14882--material-ui-x.netlify.app/ |
flaviendelangle
left a comment
There was a problem hiding this comment.
If you can wait for the alpha, I'm in favor of dropping those from the pickers
We don't add them to any new element an nobody ever asked for them on the pickers
|
Why wait for the alpha? These are completely removed from the build by a plugin. They exist solely in our codebase afaik |
No build we publish have them? |
LukasTy
left a comment
There was a problem hiding this comment.
Nice improvement! 👍
Never understood the reason for that custom query... 🤷 🙈
| if (process.env.NODE_ENV === 'production') { | ||
| plugins.push(...productionPlugins); | ||
| if (!process.env.E2E_BUILD) { | ||
| plugins.push(['babel-plugin-react-remove-properties', { properties: ['data-testid'] }]); |
There was a problem hiding this comment.
What causes this to suddenly be necessary? If possible, would be nice to keep parity between babel configs across repos. With the hope of some day just embedding it in our build tooling.
There was a problem hiding this comment.
e2e tests build the source-code using this configuration and they rely on the data-testid
If this plugin is enabled they simply don't work.
There was a problem hiding this comment.
For more context, previously it wasn't an issue because in unit tests we were using data-mui-test but e2e were using data-testid, so the data-mui-test could be removed regardless of build.
But since now both use data-testid, the issue appears
There was a problem hiding this comment.
interestingly, this rename in core was done without altering the babel config mui/material-ui#23498
There was a problem hiding this comment.
I noticed material doesn't remove the data-testid from the build, that is why they don't have this problem.
But most of the times they add data-testid in the test themselves, not the source code.
Preparing for #14508, removing deprecated apis usage