You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using latest Storybook version (8.2.9) and latest addon-svelte-csf version (4.1.7) I have this error displayed in the interaction tab of my stories, when making assertions on events.
[Function handler] is not a spy or a call to a spy!
This error disappears when reloading the story or navigating to it. It only shows when the story is rendered for the first time.
Steps to reproduce the behavior
Create a svelte library project with npm create svelte@latest myapp, then add Storybook with npx storybook@latest init
Create a new component and story using templates provided by this addon documentation (remove the existing Button component and story or give a different name to the new component / story)
In any story from the new stories.svelte file, add a simple play function with an assertion on an event :
Run storybook with npm run storybook and go to the story you eddited. In the interaction tab you should see the error [Function handler] is not a spy or a call to a spy!
Reload the story or navigate to another one then navigate back to the story, the error should be gone and the interaction tests should pass without errors.
Expected behavior
I expect the test in the play function to run without errors. This behavior happens when reloading the story.
Screenshots and/or logs
This is what I get when I console.log args inside the play function before reloading the story :
When reloading the story and everything is working fine, the log displays a proper spy :
Environment
OS: Ubuntu
Node.js version: v20.14.0
NPM version: 10.7.0
Browser (if applicable): Firefox / Chromium
Browser version (if applicable): 129.0.2 for Firefox, 127.0.6533.119 for Chromium
The text was updated successfully, but these errors were encountered:
xeho91
changed the title
[Bug] "[Function handler] is not a spy or a call to a spy" in play
[Bug][legacy - v4] "[Function handler] is not a spy or a call to a spy" in play
Nov 5, 2024
Describe the bug
When using latest Storybook version (8.2.9) and latest addon-svelte-csf version (4.1.7) I have this error displayed in the interaction tab of my stories, when making assertions on events.
[Function handler] is not a spy or a call to a spy!
This error disappears when reloading the story or navigating to it. It only shows when the story is rendered for the first time.
Steps to reproduce the behavior
npm create svelte@latest myapp
, then add Storybook withnpx storybook@latest init
npm run storybook
and go to the story you eddited. In the interaction tab you should see the error[Function handler] is not a spy or a call to a spy!
Expected behavior
I expect the test in the play function to run without errors. This behavior happens when reloading the story.
Screenshots and/or logs
This is what I get when I console.log
args
inside theplay
function before reloading the story :When reloading the story and everything is working fine, the log displays a proper spy :
Environment
The text was updated successfully, but these errors were encountered: