forked from bamlab/react-native-testing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbout.test.tsx
More file actions
23 lines (20 loc) · 795 Bytes
/
About.test.tsx
File metadata and controls
23 lines (20 loc) · 795 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import React from 'react';
import { fireEvent, debug } from 'react-native-testing-library';
import 'jest-styled-components';
import { renderPage, getPropsWithNavigation } from '../../../utils/tests/helpers';
import { wording } from '../../../utils/wording';
import { About } from '../About';
import { Routes } from '../../../navigation/routes';
describe('[Page] About', () => {
const props = getPropsWithNavigation();
it('should navigate to home page on subscribe button press', () => {
// SETUP
const page = renderPage(<About {...props} />);
// GIVEN
const NavigateSubscribeButton = page.getByText(wording.subscribe);
// WHEN
fireEvent.press(NavigateSubscribeButton);
// THEN
expect(props.navigation.navigate).toHaveBeenCalledWith(Routes.Home);
});
});