-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
selector on key-prop doesnt return any matches. #645
Comments
This is intentional. "key" is not a real prop, it's a magic thing React uses to identify array items. In other words, you need to use a different name than "key". |
You can read more about |
It would be nice if this is mentioned in the doc ( http://airbnb.io/enzyme/docs/api/selector.html ). |
enzyme docs naturally assume that you've previously read the React docs; but sure, a PR to make our docs link to the React docs on "key" and "ref" would be great. |
As someone who has read the React docs and worked with it extensively, I'd like to say:
|
You can do this instead:
|
I'd like to second point 2) of @melinath 's post above - It would great if enzyme would reconsider this decision. |
@lobsterkatie per #645 (comment), you can already do this - just using findWhere, not find. |
One issue I ran into using the |
@WalterWeidner |
What about testing the
You could simply pass the same |
Add an id (or some other identifier) to your div, or even better create a component
Then use standard
|
Either its a bug or it probably should be documented that this prop does not work
The text was updated successfully, but these errors were encountered: