-
Notifications
You must be signed in to change notification settings - Fork 668
Add filter feature on Selector functions and WrapperArray #334
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
Conversation
f640867
to
da8803b
Compare
Thanks for the PR. I'm not sure we should add this feature. We talked about adding array methods a few months ago and decided against it as it would make the API to large. Perhaps we could make an exception for |
I'm also not sure about adding a predicate to methods that take a selector. We should start a feature request issue and get some feedback. |
I need either this feature or #337, or I just can't use vue-test-utils for my component. |
You can use the suggestion 38elements gave: wrapperArr = findAll('div')
wrapperArr.wrappers = wrapperArr.wrappers.filter(w => w.element.style.visibility === 'hidden') |
On TypeScript, |
Ah, well we could potentially update the length property. I understand your use case, and we'll find a solution, but we need to discuss it first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll add the filter method, but we're not going to add a predicate to selector methods for now. Can you remove the predicate from this PR, or create a new PR that adds the filter method?
Thanks for the PR. I've added the |
This is an alternative to #328 to allow user to filter elements from WrapperArray.