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

Getting closer on Storybook and Superforms #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ciscoheat
Copy link

@ciscoheat ciscoheat commented Mar 4, 2024

I've gotten quite far with these modifications. First, a patch of the current enhance mock in the @storybook/sveltekit package was required, so pnpm is required to make it work for now.

With that, it was possible to mock the enhance function rather well, probably good enough for you to intercept the POST request, as Alex mentioned. But there's still one problem, I wasn't able to mock the navigating store, which is used in a few places when a response is returned.

According to the documentation it should be possible to mock, but it didn't work for me. Maybe you can figure it out, or if it doesn't work, there has to be some special option or detection for Superforms when using it with Storybook. Let me know what you think!

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

Successfully merging this pull request may close these issues.

1 participant