We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When a component is exported with enhanceWithClickOutside, enzyme can't find the component in it.
enhanceWithClickOutside
For example, the following fails:
test('Renders the root div', () => { const component = shallow(<MyComponent />); expect(component).toContain('div#root-div'); });
MyComponent.js
function MyComponent() { // ... return ( <div id="root-div"> {/* ... */} </div> ); } export default enhanceWithClickOutside(MyComponent)
What is the workaround?
The text was updated successfully, but these errors were encountered:
This is a general issue with higher order components. Better to ask at the enzyme project.
Resources: enzymejs/enzyme#539 maybe use dive? https://github.com/airbnb/enzyme/blob/e7226255bded93e285e36b50e16b59c8dc2458f9/docs/api/ShallowWrapper/dive.md
Sorry, something went wrong.
@nerdymax We don't use enzyme but you may find PR #25 and Issue #20 helpful for the approach we've taken.
No branches or pull requests
When a component is exported with
enhanceWithClickOutside
, enzyme can't find the component in it.For example, the following fails:
MyComponent.js
What is the workaround?
The text was updated successfully, but these errors were encountered: