Fakultas Ilmu Komputer UI

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

[REFACTOR] fix failing test

parent aa14a6d3
Pipeline #83138 passed with stages
in 10 minutes and 20 seconds
import React from 'react'; import React from 'react';
import { render } from 'utils/testing'; import { render } from '@testing-library/react-native';
import * as ROUTES from 'constants/routes';
import ChooseWeekForClient from '.'; import ChooseWeekForClient from '.';
const mockedNavigate = jest.fn();
jest.mock('@react-navigation/native', () => {
return {
useNavigation: () => ({
navigate: mockedNavigate,
}),
};
});
describe('ChooseWeekForClient', () => { describe('ChooseWeekForClient', () => {
it('renders correctly', () => { it('renders correctly', () => {
render(<ChooseWeekForClient />, ROUTES.weeklyReportChooseWeek); render(<ChooseWeekForClient />);
}); });
}); });
import React from 'react'; import React from 'react';
import { render } from 'utils/testing'; import { render } from '@testing-library/react-native';
import * as ROUTES from 'constants/routes';
import ChooseWeekForNutritionist from '.'; import ChooseWeekForNutritionist from '.';
const mockedNavigate = jest.fn();
jest.mock('@react-navigation/native', () => {
return {
useNavigation: () => ({
navigate: mockedNavigate,
}),
useRoute: () => ({
params: {
id: 1,
},
}),
};
});
describe('ChooseWeekForNutritionist', () => { describe('ChooseWeekForNutritionist', () => {
it('renders correctly', () => { it('renders correctly', () => {
render( render(<ChooseWeekForNutritionist />);
<ChooseWeekForNutritionist />,
ROUTES.weeklyReportChooseWeekForNutritionist,
{
routeParams: {
id: 1,
},
},
);
}); });
}); });
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