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
{{ message }}
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.
My use case is testing a component using the Query component that changes in response to a change in props. The problem is enzyme's setProps only works on the root node, so since I have to wrap the component in MockedProvider, the props only change for MockedProvider, not the component itself. If MockedProvider passed down other props to its child component, like the React docs recommend for HOCs, testing would be easy.
I realize that there is a workaround in separating out the component rendered by Query and testing that, but that seems to defeat the purpose of using the render props pattern instead of the graphql HOC.
The purpose of the render props is that it shares props with the parent component, so in non-testing there's not really a benefit to this in my opinion.
I put together a PR showing what I mean. I've never worked with TypeScript before, so I apologize for the clumsiness in the code, but the idea is there. #2482
My use case is testing a component using the
Query
component that changes in response to a change in props. The problem is enzyme'ssetProps
only works on the root node, so since I have to wrap the component inMockedProvider
, the props only change forMockedProvider
, not the component itself. IfMockedProvider
passed down other props to its child component, like the React docs recommend for HOCs, testing would be easy.I realize that there is a workaround in separating out the component rendered by
Query
and testing that, but that seems to defeat the purpose of using the render props pattern instead of thegraphql
HOC.The text was updated successfully, but these errors were encountered: