Fakultas Ilmu Komputer UI

index.test.tsx 1.2 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
import React from 'react';
import { render } from 'utils/testing';
import * as ROUTES from 'constants/routes';
import { pages } from '../../pages';

import DietProfilePage from '.';
import { mockDietQuestionnaire } from '__mocks__/dietQuestionnaire';

describe('DietProfilePage', () => {
  it('identity page renders correctly', () => {
    render(
      <DietProfilePage content={pages[0](mockDietQuestionnaire)} />,
      ROUTES.clientProfileNutritionist,
    );
  });
  it('eating pattern page renders correctly', () => {
    render(
      <DietProfilePage content={pages[1](mockDietQuestionnaire)} />,
      ROUTES.clientProfileNutritionist,
    );
  });
  it('daily food consumption page renders correctly', () => {
    render(
      <DietProfilePage content={pages[2](mockDietQuestionnaire)} />,
      ROUTES.clientProfileNutritionist,
    );
  });
  it('lifestyle page renders correctly', () => {
    render(
      <DietProfilePage content={pages[3](mockDietQuestionnaire)} />,
      ROUTES.clientProfileNutritionist,
    );
  });
  it('health condition page renders correctly', () => {
    render(
      <DietProfilePage content={pages[4](mockDietQuestionnaire)} />,
      ROUTES.clientProfileNutritionist,
    );
  });
});