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

chore(findComponent): refactor find & findComponent (fixes #716, #899) #1110

Merged
merged 2 commits into from
Nov 29, 2021

Conversation

xanf
Copy link
Collaborator

@xanf xanf commented Nov 26, 2021

This is reopen of #1094 which was occasionally merged by me, and immediately force-pushed in master to revert merge
/cc @lmiller1990 @cexbrayat

* allow find also find DOM nodes by ref
* generalize findAll/findAll components behavior
* greatly improve typings
* add types tests for findComponent
@xanf xanf changed the title Improve find v2 chore(findComponent): refactor find & findComponent (fixes #716, #899) Nov 26, 2021
@xanf
Copy link
Collaborator Author

xanf commented Nov 26, 2021

side note: please do not do immediate release on merging this one, I have two more PRs to do right on top of this one

@lmiller1990 lmiller1990 merged commit 81dc7f1 into master Nov 29, 2021
@lmiller1990 lmiller1990 deleted the improve-find-v2 branch November 29, 2021 07:10
@lmiller1990
Copy link
Member

Let me know when you'd like another release of VTU :)

@nandi95
Copy link
Contributor

nandi95 commented Feb 18, 2022

@xanf I don't fully understand why this change was necessary?

Can you help me understand?
Just checking that this was intentional.
Element extends Node, surely we're missing out by this change no?
https://github.com/vuejs/test-utils/pull/1110/files#diff-6465880aeaebd068f6cc391d06a440cee566347bcc0af1ae490698b21b2f8f32L14-R27

@xanf
Copy link
Collaborator Author

xanf commented Feb 21, 2022

@nandi95 This is intended change.

Consider following component:

<template>
  <template v-if="false">Hello</template>
</template>

This will result in component being rendering as single Node <!-- v-if -->, so wrapper.element will point to Node, not Element

@nandi95
Copy link
Contributor

nandi95 commented Feb 21, 2022

That makes sense. thanks!

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.

3 participants