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

wrapper.props() not working with mountSuspended #1064

Open
sebbayer opened this issue Jan 10, 2025 · 1 comment
Open

wrapper.props() not working with mountSuspended #1064

sebbayer opened this issue Jan 10, 2025 · 1 comment

Comments

@sebbayer
Copy link

Environment


  • Operating System: Linux
  • Node Version: v18.20.3
  • Nuxt Version: 3.15.1
  • CLI Version: 3.20.0
  • Nitro Version: 2.10.4
  • Package Manager: [email protected]
  • Builder: -
  • User Config: -
  • Runtime Modules: -
  • Build Modules: -

Reproduction

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

Describe the bug

When I mount a component using await mountSuspended() and call wrapper.props(), an empty object is returned.

This is probably caused by the wrapping <Suspense> component. I also had no success trying to get the original mounted component first, e.g. using wrapper.findComponent(MyComponent), but that returns null. I would expect it to return the component instead.

See https://test-utils.vuejs.org/api/#props-1

Additional context

No response

Logs

@sebbayer sebbayer changed the title wrapper.props() and findComponent() not working with mountSuspended wrapper.props() and wrapper.findComponent() not working with mountSuspended Jan 10, 2025
@sebbayer sebbayer changed the title wrapper.props() and wrapper.findComponent() not working with mountSuspended wrapper.props() not working with mountSuspended Jan 10, 2025
@sebbayer
Copy link
Author

It is working with wrapper.findComponent({ name: 'MountSuspendedComponent' }).props() but that seems more like a workaround to me.

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

2 participants