You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For all my components currently decorated with connect, instead of getting the correct displayName in a snapshot, after bumping to the latest version of react-redux (hooks), the only thing I get is <ConnectFunction instead of <Connect(MyComponent).
By debugging a bit, I found out that this is happening due to how react-enzyme-adapter-16 and enzyme-adapter-utils extract the displayName, as you can see here:
Current behavior
For all my components currently decorated with
connect
, instead of getting the correctdisplayName
in a snapshot, after bumping to the latest version ofreact-redux
(hooks), the only thing I get is<ConnectFunction
instead of<Connect(MyComponent)
.By debugging a bit, I found out that this is happening due to how
react-enzyme-adapter-16
andenzyme-adapter-utils
extract thedisplayName
, as you can see here:https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js#L801
and here:
https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-utils/src/Utils.js#L120
This is the
node
data that gets passed:Expected behavior
It should check and extract the
displayName
fromnode.type
if present, instead of gettingnode.type.type.name
by default (React.memo
).I believe the correct implementation could be:
https://github.com/airbnb/enzyme/blob/master/packages/enzyme-adapter-react-16/src/ReactSixteenAdapter.js#L806
But not 100% sure about the side-effects that it might have.
Your environment
API
Version
Adapter
The text was updated successfully, but these errors were encountered: