storybook-framework-qwik
storybook-framework-qwik copied to clipboard
QRL/function props spies in interaction tests
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?