Fakultas Ilmu Komputer UI

Commit 74312e47 authored by Kefas Satrio Bangkit Solideantyo's avatar Kefas Satrio Bangkit Solideantyo
Browse files

[REFACTOR] move mockAxios up

parent 8e6cda9f
Pipeline #84420 failed with stages
in 5 minutes and 36 seconds
......@@ -14,6 +14,13 @@ describe('DietReportForNutritionist', () => {
const data = mockUserReportResponse;
it('renders and submits correctly when given valid comments', async () => {
mockAxios.request.mockImplementationOnce(() =>
Promise.resolve({
status: 200,
data: undefined,
}),
);
const { queryByText, getByText, getAllByPlaceholderText } = render(
<DietReportForNutritionist />,
ROUTES.clientDietReportNutritionist,
......@@ -21,12 +28,6 @@ describe('DietReportForNutritionist', () => {
routeParams: data,
},
);
mockAxios.request.mockImplementationOnce(() =>
Promise.resolve({
status: 200,
data: undefined,
}),
);
const textFieldsPage1 = getAllByPlaceholderText(/Tuliskan komentar.../i);
textFieldsPage1.forEach((field) => {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment