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

renderSuspended does not handle onEvent notation #731

Open
pguilbert opened this issue Jan 22, 2024 · 0 comments
Open

renderSuspended does not handle onEvent notation #731

pguilbert opened this issue Jan 22, 2024 · 0 comments

Comments

@pguilbert
Copy link

Environment


  • Operating System: Linux
  • Node Version: v18.18.0
  • Nuxt Version: 3.9.3
  • CLI Version: 3.10.0
  • Nitro Version: 2.8.1
  • Package Manager: [email protected]
  • Builder: -
  • User Config: devtools
  • Runtime Modules: -
  • Build Modules: -

Reproduction

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

Describe the bug

One convenient method for verifying that a component has emitted the expected events is to pass a prop with "onX" that contain a mocked function:

const onTest = vi.fn()
render(MyComponent, {
  props: { title: 'Test title', onTest},
});
expect(onTest).toHaveBeenCalled(); 

While this works fine with the testing library render helper, Nuxt's renderSuspended fails to pass the event handler to the component:

await renderSuspended(MyComponent, {
  props: { title: 'Test title', onTest },
});
expect(onTest).toHaveBeenCalled(); 

Additional context

No response

Logs

No response

@dosubot dosubot bot added the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label Apr 24, 2024
@dosubot dosubot bot closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2024
@dosubot dosubot bot removed the stale Issue has not had recent activity or appears to be solved. Stale issues will be automatically closed label May 1, 2024
@danielroe danielroe reopened this May 1, 2024
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