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

QRL/function props spies in interaction tests #79

Open
k-schneider opened this issue Nov 21, 2024 · 0 comments
Open

QRL/function props spies in interaction tests #79

k-schneider opened this issue Nov 21, 2024 · 0 comments

Comments

@k-schneider
Copy link

k-schneider commented Nov 21, 2024

If I have a button with a simple onClick$ handler, how might I go about asserting that the QRL was invoked?

The storybook docs recommend you use fn() which returns a spy so in React your test can simply use expect(args.onClick).toHaveBeenCalled(); to verify.

With Qwik, you need to pass QRL's so how can you verify they're invoked? I tried wrapping a spy into a QRL and then asserting the underlying spy was invoked but it never is (assuming that serialization breaks this somehow?).

Is this possible?

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

No branches or pull requests

1 participant