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(find): find and findAll should not find itself on DOM wrappers #1392

Merged
merged 1 commit into from Mar 28, 2022

Conversation

xanf
Copy link
Collaborator

@xanf xanf commented Mar 26, 2022

This is alternate approach to fix #1233
Other approach: #1377

What I'm liking about this approach:

  • we're not introducing any flags
  • we're just moving findAll implementation to DOMWrapper/VueWrapper to distinguish behavior on Vue wrapper / DOM (semantics 🥇 )

@netlify
Copy link

netlify bot commented Mar 26, 2022

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

Name Link
🔨 Latest commit 6484d0b
🔍 Latest deploy log https://app.netlify.com/sites/vue-test-utils-docs/deploys/623f744ecbf4f20009d7fe19
😎 Deploy Preview https://deploy-preview-1392--vue-test-utils-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@@ -93,18 +94,6 @@ describe('find', () => {
expect(wrapper.find('.foo').exists()).toBe(true)
})

it('returns the root element from dom wrapper if it matches', () => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This test now makes no sense, it captured previous behavior

I've added alternate test at the bottom of this file

@lmiller1990
Copy link
Member

Let's ship it 💪

@lmiller1990 lmiller1990 merged commit 1923223 into main Mar 28, 2022
@lmiller1990 lmiller1990 deleted the fix-do-not-include-self 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
2 participants