Skip to content
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

Document CSS selectors when using shallow mounting #608

Closed

Conversation

Wilfred
Copy link

@Wilfred Wilfred commented Sep 26, 2016

I was a little confused by this today, and realised that selectors don't apply to rendering of child components. As far as I can see, this isn't currently documented in the selectors docs.

I propose adding a note to the docs about this. Alternatively, we could add the note to .find on https://github.com/airbnb/enzyme/blob/master/docs/api/ShallowWrapper/find.md instead. Let me know what you think.

@ljharb
Copy link
Member

ljharb commented Sep 26, 2016

We can add this if other contributors feel it necessary, but this is kind of the sole purpose of shallow rendering - to render shallowly, ie, not to render child components.

@nfcampos
Copy link
Collaborator

hmm yes, I agree with @ljharb this is the whole point of the shallow renderer, if this is confusing we should instead better explain the difference between shallow and mount

@aweary
Copy link
Collaborator

aweary commented Sep 28, 2016

I agree, if anything we should clarify shallow rendering elsewhere, or link to resources that explain it. I don't think the selectors API doc is the place to do that, but we appreciate the PR @Wilfred!

@aweary aweary closed this Sep 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants