Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace enzyme with React testing library (#2086)
* chore: Migrated enzyme tests to react-testing-render or @testing-library/react. This is required for an upgrade to React 18, which enzyme does not support. I've tried to keep the impact on the tests as small as possible. Shallow snapshot tests use react-test-renderer/shallow.createRenderer Deep snapshot tests use react-test-renderer.create Interaction tests use @testing-library/react.render In snapshots 'class' changed to 'className'. The 'key' property is no longer emitted. Injected HTML is formatted differently (quoted an no newlines). Some tests navigated into the render output to pick out a smaller piece to snapshot. That was too difficult to replicate. There is a problem with the deabsdeep/serializer. It breaks serialization of React Elements, because the map 'loses' the $$typeof marker used by jest's native React serializer. I've copied the serializer code into this project and fixed the problem. In the future we could look at using this serializer selectively for only tests that needs it. deabsdeep library is still used in places, just not the serializer. * chore: remove enzyme config from jest setup * chore: remove enzyme dependencies * chore: add temp istanbul / codecov ignore related: 212cf66 * fix: fix some name conflict eslint warnings Co-authored-by: Frits van Campen <Frits.vanCampen@moxio.com> Co-authored-by: Thomas Roest <thomas.roest@moxio.com>
- Loading branch information