Fakultas Ilmu Komputer UI

index.test.tsx 1.71 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import React from 'react';
import { render } from 'utils/testing';
import * as ROUTES from 'constants/routes';

import DietReportPage from '.';
import { dietReportPage1 } from '../../pages/DietReportPage1';
import { mockUserReportResponse } from '__mocks__/userReport';
import { dietReportPage } from '../../pages/types';
import { dietReportPage2 } from '../../pages/DietReportPage2';
import { dietReportPage3 } from '../../pages/DietReportPage3';
import { dietReportPage4 } from '../../pages/DietReportPage4';

describe('DietReportPage', () => {
  it('diet report page 1 renders correctly', () => {
    render(
      <DietReportPage
        pageName={dietReportPage.PAGE1}
        content={dietReportPage1(mockUserReportResponse, jest.fn())}
        getTextInputProps={jest.fn()}
      />,
      ROUTES.clientDietReportNutritionist,
    );
  });
  it('diet report page 2 renders correctly', () => {
    render(
      <DietReportPage
        pageName={dietReportPage.PAGE2}
        content={dietReportPage2(mockUserReportResponse, jest.fn())}
        getTextInputProps={jest.fn()}
      />,
      ROUTES.clientDietReportNutritionist,
    );
  });
  it('diet report page 3 renders correctly', () => {
    render(
      <DietReportPage
        pageName={dietReportPage.PAGE3}
        content={dietReportPage3(mockUserReportResponse, jest.fn())}
        getTextInputProps={jest.fn()}
      />,
      ROUTES.clientDietReportNutritionist,
    );
  });
  it('diet report page 4 renders correctly', () => {
    render(
      <DietReportPage
        pageName={dietReportPage.PAGE4}
        content={dietReportPage4(mockUserReportResponse, jest.fn())}
        getTextInputProps={jest.fn()}
      />,
      ROUTES.clientDietReportNutritionist,
    );
  });
});