Fakultas Ilmu Komputer UI

Commit 53cccfa8 authored by Doan Andreas Nathanael's avatar Doan Andreas Nathanael
Browse files

[RED] add test for params to diet recom form

parent 9c0cb6c5
import React from 'react'; import React from 'react';
import { render } from 'utils/testing'; import { render, waitFor } from 'utils/testing';
import * as ROUTES from 'constants/routes'; import * as ROUTES from 'constants/routes';
import axios from 'axios';
import ReadOnlyDietProfile from '.'; import ReadOnlyDietProfile from '.';
import { mockDietQuestionnaire } from '__mocks__/dietQuestionnaire'; import { mockDietQuestionnaire } from '__mocks__/dietQuestionnaire';
jest.useFakeTimers();
jest.mock('axios');
const mockAxios = axios as jest.Mocked<typeof axios>;
describe('ReadOnlyDietProfile', () => { describe('ReadOnlyDietProfile', () => {
it('renders correctly', () => { it('renders correctly', () => {
render(<ReadOnlyDietProfile />, ROUTES.clientProfileNutritionist, { render(<ReadOnlyDietProfile />, ROUTES.clientProfileNutritionist, {
routeParams: mockDietQuestionnaire, routeParams: mockDietQuestionnaire,
}); });
}); });
it('shows "Klien belum mengisi diet questionnaire" text if no questionnaire answer is provided yet', () => { it('shows "Klien belum mengisi diet questionnaire" text if no questionnaire answer is provided yet', () => {
const { getByText } = render( const { getByText } = render(
<ReadOnlyDietProfile />, <ReadOnlyDietProfile />,
......
Supports Markdown
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