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
This might be a tricky corner case where this add-on and next/router don't play nicely, but just in case...
The system I work on heavily uses the ability to set up internal APIs as part of the NextJs page/app routing stack. We have components that call it directly via fetch to then call out to other external APIs as a way to hide sensitive information from the client.
Unfortunately, any way I try to mock the call seems to fail; in theory it should be a straightforward intercept to a local url, but it doesn't seem to be switching to the mock. Intercepting what the api route would call doesn't work either as the api route gets in the way - I just get a 404 back.
I have tried the router settings from the NextJs Storybook framework but no joy.
My fetch call is a straightforward const res = await fetch(/api/review-badge?trustYouId=${trustYouId});
My Storybook meta looks like (with an arg of foo being passed in):
This might be a tricky corner case where this add-on and next/router don't play nicely, but just in case...
The system I work on heavily uses the ability to set up internal APIs as part of the NextJs page/app routing stack. We have components that call it directly via fetch to then call out to other external APIs as a way to hide sensitive information from the client.
Unfortunately, any way I try to mock the call seems to fail; in theory it should be a straightforward intercept to a local url, but it doesn't seem to be switching to the mock. Intercepting what the api route would call doesn't work either as the api route gets in the way - I just get a 404 back.
I have tried the router settings from the NextJs Storybook framework but no joy.
My fetch call is a straightforward
const res = await fetch(
/api/review-badge?trustYouId=${trustYouId});
My Storybook meta looks like (with an arg of foo being passed in):
The mocking add-on is present and, as far as I can tell, doing what it's supposed to.
The text was updated successfully, but these errors were encountered: