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