Skip to content

How to test teleport, if subcomponents not a vue component #798

@Yijx

Description

@Yijx

I have a vue component like this

<template>
  <teleport to="body">
     <div class="hello">
    </div>
  </teleport>
</template>

It is different from https://next.vue-test-utils.vuejs.org/guide/advanced/teleport.html
I can use document.body.querySelect('.hello'), it is work.
but wrapper.find or wrapper.findComponent, they are not work.
so, how can i test this component, it is a same question in stackoverflow https://stackoverflow.com/questions/66923194/how-to-make-vue3-test-utils-work-with-teleport

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions