Skip to content
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

Fixed crash when calling .simulate on an emotion styled component #13

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

leroydev
Copy link

@leroydev leroydev commented Apr 17, 2024

This fixes #12 for me locally.
Without this fix, I had this error 6 times in a pretty big private codebase.
This fix doesn't result in any problems in this codebase, while it does have ~1500 enzyme unit test cases and ~250 styled components. It also makes heavy use of Material UI V5, which also uses emotion.
I made a minimum reproducible example here: https://github.com/leroydev/enzyme-adapter-react-emotion-issue and also included a way to test this fix by inlining ReactEighteenAdapter.ts with the proposed change.

After cloning this repo and running npm i, the old and new behavior can be compared by running npm run original-test/npm run changed-test 🙂

@cfaester cfaester self-assigned this Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants