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

fix: do not include self when using findAll #1377

Closed
wants to merge 3 commits into from

Conversation

lmiller1990
Copy link
Member

resolves #1233

Seems too easy 🤔

@lmiller1990 lmiller1990 requested review from xanf and cexbrayat March 21, 2022 12:45
@netlify
Copy link

netlify bot commented Mar 21, 2022

✅ Deploy Preview for vue-test-utils-docs ready!

🔨 Explore the source changes: a9fd8b5

🔍 Inspect the deploy log: https://app.netlify.com/sites/vue-test-utils-docs/deploys/6238f3b344442300087dd839

😎 Browse the preview: https://deploy-preview-1377--vue-test-utils-docs.netlify.app

@lmiller1990
Copy link
Member Author

cc @freakzlike @aethr WDYT?

Copy link
Member

@cexbrayat cexbrayat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xanf
Copy link
Collaborator

xanf commented Mar 21, 2022

👀 Looking on this right now

@xanf
Copy link
Collaborator

xanf commented Mar 21, 2022

@lmiller1990 This breaks the logic we've discussed in #1233

    expect(wrapper.findAll('div').length).toBe(4) // actually returns 3

Let's keep this discussion in #1233 (comment) to keep all the context in one place

@lmiller1990
Copy link
Member Author

@xanf pushed a commit to fix that.

@xanf
Copy link
Collaborator

xanf commented Mar 26, 2022

@lmiller1990 looking

@xanf
Copy link
Collaborator

xanf commented Mar 26, 2022

@lmiller1990 while reviewing your PR I've found another failing case - https://github.com/vuejs/test-utils/pull/1392/files#diff-9835123bc80f420fd7ebbcc25a72c73e7f2c8934bac14a9a3bbe6e1dca3569f7R356

And I believe I've figured more elegant approach in #1392
Could you please look at that (basically we simply separated implementations of findAll for VueWrapper and DOMWrapper.
Feel free to close that PR is favor of this one if you feel that this approach is better

/cc @cexbrayat

@lmiller1990 lmiller1990 deleted the ignore-self-findAll branch March 28, 2022 01:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: findAll returns parent node in result array
3 participants