Open nicwells opened 1 year ago
Looks to me like this should be pretty easy to fix. What do you think, @shilman ?
@bodograumann Indeed! Anybody want to give this a go? PRs welcome and would be prioritized.
@bodograumann Indeed! Anybody want to give this a go? PRs welcome and would be prioritized.
PR opened, thx!
Describe the bug
Using dates in
expect
statements (from @storybook/jest) within interaction tests (@storybook/addon-interactions) causes storybook to crash when running in the browser, resulting in a blank screen and the following error in the console:The expect in the following play function causes the error for example:
The tests pass when running in test-runner.
The error looks to originate from this line in @storybook/addon-interactions where the dates are being rendered for display in the addon-interactions panel (the split string function is being called on the date object): https://github.com/storybookjs/storybook/blob/e9f2e1f7112fc5e391b82ff2d871d3656f5cdfee/code/addons/interactions/src/components/MethodCall.tsx#L345
The error occurs in v7.4.6 and the latest, as in the reproduction linked to below. The error did not occur in v6.5.16 which we were previously on.
To Reproduce
This error occurs in v7.4.6 of Storybook, also in the latest as in the reproduction link below. The error did not occur in v6.5.16.
Line #35 of Button.stories.js in the reproduction results in the error (i.e. white screen and error in console):
https://stackblitz.com/edit/github-pjbwb9?file=stories%2FButton.stories.js
System
No response
Additional context
No response