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

setProps not working with mountSuspended #534

Closed
maartenvanhunsel opened this issue Jul 8, 2023 · 1 comment
Closed

setProps not working with mountSuspended #534

maartenvanhunsel opened this issue Jul 8, 2023 · 1 comment

Comments

@maartenvanhunsel
Copy link
Contributor

When updating setProps the target component is not being updated.

Extraneous non-props attributes (title) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. 

Reproduction: https://stackblitz.com/edit/nuxt-starter-quawkh?file=pages%2F__tests__%2FTestComponent.nuxt.spec.js

@oskarols
Copy link
Contributor

oskarols commented Jul 24, 2023

I've looked briefly into this. It's stemming from the fact that we're not rendering the component directly but are wrapping the component. This makes setProps not work since it's not actually calling it on the passed in component but rather on the wrapper.

I tried refactoring mountSuspended to run VueWrapper.getComponent() to return the inner component instead. Unfortunately running setProps on an inner component like this is not allowed in vue-test-utils so it does not work.

@danielroe danielroe transferred this issue from danielroe/nuxt-vitest Dec 2, 2023
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

3 participants