-
Notifications
You must be signed in to change notification settings - Fork 668
Provide an API to get wrapped refs #473
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
Comments
We actually do support ref selectors: const buttonWrapper = wrapper.find({ ref: 'myButton' })
buttonWrapper.trigger('click') It was discussed in this thread—#67 We should probably improve the docs to improve visibility. |
Oh, great! |
I really like @LinusBorg's suggestion here:
Doesn't appear to be difficult to implement, but I think it'd be nice to pull one or more wrappers from the usage of |
I think we should keep the find and findAll methods for traversing the rendered nodes. Since we already support a ref selector in find, I'm closing this issue. |
What problem does this feature solve?
we currently have
wrapper.find()
which can be used to select an element by a CSS selector, or find a component instance by name/constructor. Find returns a Wrapper for the item that was found.We don't have a similar way of using a ref. We can do:
But that will give use the plain element, not a wrapped version, so we can't use the Wrapper's helpers on this element.
The same is true for component refs, of course
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: