mui / material-ui

Material UI: Ready-to-use foundational React components, free forever. It includes Material UI, which implements Google's Material Design.
https://mui.com/material-ui/
MIT License
92.58k stars 31.91k forks source link

[core] Remove enzyme #42454

Closed DiegoAndai closed 6 days ago

DiegoAndai commented 1 month ago

Summary

For our tests to be compatible with React 19, we must replace Enzyme. Enzyme has been dead for a while now, and we had an adapter to work with React 18. Instead of creating a new adapter, we've decided it's time to migrate.

Migration

The tests will be migrated to React Testing Library (RTL), which we already use. The steps we'll need to take on our tests are:

RTL has different guiding principles from Enzyme. In a nutshell, it discourages testing implementation details. In this migration, we'll embrace this principle as it's to be the industry standard. This means some tests will require adapting, striving to test the same functionality but following this new guiding principle.

Tasks

DiegoAndai commented 1 month ago

@aarongarciah please add other tasks if there are any so we can keep this issue updated 😊

aarongarciah commented 3 weeks ago

All tasks are now completed in next. Should we keep this open until we backport the changes to master?

DiegoAndai commented 3 weeks ago

Should we keep this open until we backport the changes to master?

Yes, I added a task for it 😊

aarongarciah commented 6 days ago

Completed via https://github.com/mui/material-ui/pull/42706 and https://github.com/mui/material-ui/pull/42850