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
I prefer using Storybook for UI component management and testing. I've used it before on other NextJS projects and the mocking features of Storybook work well. Specifically the sb.mock method to automatically mock a method (like a local API action). sb.mock works fine on my other projects, but I haven't been able to get it working with Payload. From what I can tell, the mock hoisting never runs, as if it's being overwritten. Storybook doesn't seem to think any mocking is occurring (at least based on the logs files). I know Payload is doing some things behind the scenes with NextJS and even has its preferred test frameworks. I'm just curious if anyone has successfully tested in Storybook with Payload, or may know what in Payload could be interfering with the sb.mock hoisting? Thank you!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I prefer using Storybook for UI component management and testing. I've used it before on other NextJS projects and the mocking features of Storybook work well. Specifically the
sb.mockmethod to automatically mock a method (like a local API action).sb.mockworks fine on my other projects, but I haven't been able to get it working with Payload. From what I can tell, the mock hoisting never runs, as if it's being overwritten. Storybook doesn't seem to think any mocking is occurring (at least based on the logs files). I know Payload is doing some things behind the scenes with NextJS and even has its preferred test frameworks. I'm just curious if anyone has successfully tested in Storybook with Payload, or may know what in Payload could be interfering with thesb.mockhoisting? Thank you!Here is my Storybook
main.tsAnd my
preview.tsBeta Was this translation helpful? Give feedback.
All reactions