-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Problem with multiple mocks in the same story. #64
Comments
Yep, I'm experiencing the same issue |
NicolasBonduel
added a commit
to NicolasBonduel/storybook-addon-mock
that referenced
this issue
Nov 12, 2021
I found the issue and fixed it in the PR above. An easy way to fix it in the meantime is to set the method in each mockData. On my example, it would be: Appointment.parameters = {
mockData: [
{
url: `${process.env.ENDPOINT}/appointments/CURRENT`,
response: responses.CURRENT,
method: 'GET',
},
{
url: `${process.env.ENDPOINT}/appointments/EARLY`,
response: responses.EARLY,
method: 'GET',
},
{
url: `${process.env.ENDPOINT}/appointments/LATE`,
response: responses.LATE,
method: 'GET',
},
{
url: `${process.env.ENDPOINT}/appointments/CANCELLED`,
response: responses.CANCELLED,
method: 'GET',
},
],
}; @adamgilmour, this might be interesting for you. |
@NicolasBonduel the change reflects on version 1.7.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am trying to mock multiple requests for the same component, such as:
It seems that only the latest mockData of the array is used, and the other ones are ignored. Am I doing something wrong?
The text was updated successfully, but these errors were encountered: