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

Rerender from @testing-library/vue not working #1014

Open
LeoMo-27 opened this issue Nov 14, 2024 · 0 comments
Open

Rerender from @testing-library/vue not working #1014

LeoMo-27 opened this issue Nov 14, 2024 · 0 comments

Comments

@LeoMo-27
Copy link

LeoMo-27 commented Nov 14, 2024

Environment

  • Operating System: Darwin
  • Node Version: v22.11.0
  • Nuxt Version: 3.14.159
  • CLI Version: 3.15.0
  • Nitro Version: 2.10.3
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

https://stackblitz.com/edit/github-5sxamx-wxweax?file=components%2FMyComponent.nuxt.spec.ts

Describe the bug

When using rerender from @testing-library/vue the rendered component does not receive the props passed in the method. The issue is related with the suspense wrapper component created on the renderSuspended wrapper of the render method.

In the reproduction, you can see that the wrapper component created is the one that inherits the props passed to the rerender method. The expected HTML should look like this:

<body>
  <div
    data-v-app=""
    id="__nuxt"
  />
  <div>
    <div
      id="test-wrapper"
    >
      <p>
        Hello Vue 3
      </p>
    </div>
  </div>
</body>

But it looks like this:

<body>
  <div
    data-v-app=""
    id="__nuxt"
  />
  <div>
    <div
      id="test-wrapper"
      msg="Hello Vue 3"
    >
      <p>
        Hello in component
      </p>
    </div>
  </div>
</body>

Additional context

I tried solving the issue with no avail, I'm sorry I can not be of more help 😢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant