We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
onEvent
https://stackblitz.com/edit/github-5sxamx?file=components%2FMyComponent.nuxt.spec.ts
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:
render
await renderSuspended(MyComponent, { props: { title: 'Test title', onTest }, }); expect(onTest).toHaveBeenCalled(); ❌
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Environment
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:
While this works fine with the testing library
render
helper, Nuxt'srenderSuspended
fails to pass the event handler to the component:Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: