-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Make library work with render
#25
Comments
Does anybody actually use the |
Hi, actually I do use render for presentational components. There's often cases I want to test child elements and render is a bit easier. Otherwise you need the sub components imported to be able to assert against them. const Svg = () => <svg />
const Foo = () => <div><Svg /></div> With render: expect(wrapper.find('svg').toBePresent(). With shallow: import Svg from '...';
expect(wrapper.find(Svg).toBePresent(). Recently switched to Jest, so we might actually do more snapshots, but still. |
That's good to know. Thanks for reporting. I think we'all be in an easier place to support this after #39 is done. |
@pascalduez you can use find by name with shallow without a problem. so your With shallow code will be: expect(wrapper.find('Svg')).toBePresent(); |
@luizbon Thanks for the feedback, I'll give it another try. Still, there are (few) cases where I'd like to test against "real" DOM elements, but well. |
Currently we are doing nothing with
render
ed components. chai-enzyme is supporting them nicely. We should find a way to supportrender
ed components.The text was updated successfully, but these errors were encountered: