cy.intercept() mocks the response first time. But, if I try again second time with a different response, it does not work.
cy.intercept(
{
method: 'GET',
url: `get/note`,
},
{
body: {
statusCode: 200,
message: 'Request successful',
result: [],
},
}
).as('loadComments1');
cy.intercept(
{
method: 'GET',
url: `get/note`,
},
{
body: {
statusCode: 200,
message: 'Request successful',
result: seededNoteComments,
},
}
).as('loadComments2');