Skip to content
This repository was archived by the owner on Apr 18, 2023. It is now read-only.
This repository was archived by the owner on Apr 18, 2023. It is now read-only.

TypeError: Cannot read properties of undefined (reading '__reactFiber$bn58ztremuh') while simulating event on MUI components #45

@OmkarRajam

Description

@OmkarRajam

While using React 17, MUI 5, and latest version of @wojtekmaj/enzyme-adapter-react-17 (which is 0.6.7), when we try to simulate an event (like click or mouseenter) on MUI components like Button, IconButton or Tab, we get an error like TypeError: Cannot read property '__reactFiber$g9li6s00347' of undefined

Here is a CodeSandbox reproducing the error - https://codesandbox.io/s/react17-enzyme-simulate-click-49y6pb?file=/src/components/BasicButton.test.js

I also created a CodeSandbox to see if there is such an error while using enzyme-adapter-react-16 with React 16 and MUI 4. But I didn't find such an error in it. Here is that CodeSandbox - https://codesandbox.io/s/react16-enzyme-simulate-click-67w2pj?file=/src/components/BasicButton.test.js

I think this issue is similar to the issue - #42. In that issue, return value of _nodeToHostNode in ReactSeventeenAdapter was some null values followed by non-null value. In this case though, all values returned from _nodeToHostNode are null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions