-
Notifications
You must be signed in to change notification settings - Fork 668
Update find
and findAll
to be more robust
#692
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
@@ -74,13 +74,7 @@ describeWithShallowAndMount('contains', (mountingMethod) => { | |||
expect(fn).to.throw().with.property('message', message) | |||
}) | |||
|
|||
it('returns true when wrapper contains root element', () => { |
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.
this exact tests appeared twice (duplicated by accident I guess) and also description was wrong so updated for this PR (it was a failing test so I noticed it).
I don't agree the objections raised by @38elements , I think The I think we should match the Of course this is not essential, but I think it makes writing tests more compact (thus readable) and easier to learn. Anyway, I think you made your strong objections clear. If other people share the opinion this is not a useful feature, please chime in, we should do what most people feel is a good idea. @eddyerburgh expressed a positive opinion of this feature in the initial issue, #651 , so unless something has changed since then, I would like to continue working on this feature until it's able to be merged. |
I didn't think there would be objections to this feature. Can you create an issue to discuss it. My opinion is still to add it. I've seen people assume that tag selectors work for instances. The concern I have is with pseudo selectors and tags: wrapper.find('a custom-component') // will be unsuccessful. We should throw an error to let users know it's not possible I can understand @38elements concern over the tag selector returning an instance, but we're implementing similar behavior with #687. @lmiller1990 I also don't like using the name selector, are you aware that you can use the component options as a selector? If so is there a reason that your team use the name selector over the constructor? import SomeComponent from './SomeComponent.vue'
wrapper.find(SomeComponent) |
Ok, let's discuss in the original issue, #651 added my thoughts there. |
I think that it is better to create a new issue.
#687 is not the similar behavior. |
@38elements ok, I made a new issue. BTW, I wasn't suggesting removing the existing function of, just extending it. it is here: #695 |
@lmiller1990 |
Second attempt at #651 . First attempt and related comments in #681 which I closed in favor of this.
Allows users to use
find
andfindAll
on atag
. Example:@eddyerburgh thanks for previous feedback, updated using a
TAG_SELECTOR
andisTagSelector
method.@38elements not sure how you feel about this feature but I updated using some of your comments on the previous PR, mainly not using the external npm packages for html/svg elements.