PromucFlow_constructor/app/client/test/__mocks__/apiHandlers.ts
Rishabh Saxena 244930dd69
Add support of component unit testing (#3828)
Update jest config, add msw hooks
2021-04-02 15:17:16 +05:30

14 lines
543 B
TypeScript

import { rest } from "msw";
import CreateOrganisationMockResponse from "mockResponses/CreateOrganisationMockResponse.json";
import ApplicationsNewMockResponse from "mockResponses/ApplicationsNewMockResponse.json";
export const handlers = [
// mock apis here
rest.post("/api/v1/organizations", (req, res, ctx) => {
return res(ctx.status(200), ctx.json(CreateOrganisationMockResponse));
}),
rest.get("/api/v1/applications/new", (req, res, ctx) => {
return res(ctx.status(200), ctx.json(ApplicationsNewMockResponse));
}),
];