fix: use actual react-native instead of homegrown mocks (#36)

<!-- Please provide enough information so that others can review your pull request. -->
<!-- Keep pull requests small and focused on a single change. -->

### Summary

This actually uncovered some bugs, like lack of `onDoublePress` (lol XD) and enabled us to have better snapshots for deep rendering.

### Test plan

no new tests
This commit is contained in:
Michał Pierzchała
2018-10-16 18:51:01 +02:00
committed by GitHub
parent 07d3be1c51
commit 03e2c4b0f2
14 changed files with 1882 additions and 138 deletions
-19
View File
@@ -193,25 +193,6 @@ const { getByTestId } = render(
fireEvent.press(getByTestId('button'));
```
### `fireEvent.doublePress: (element: ReactTestInstance) => void`
Invokes `doublePress` event handler on the element or parent element in the tree.
```jsx
import { TouchableOpacity, Text } from 'react-native';
import { render, fireEvent } from 'react-native-testing-library';
const onDoublePressMock = jest.fn();
const { getByTestId } = render(
<TouchableOpacity onDoublePress={onDoublePressMock}>
<Text testID="button-text">Click me</Text>
</TouchableOpacity>
);
fireEvent.doublePress(getByTestId('button-text'));
```
### `fireEvent.changeText: (element: ReactTestInstance, data?: *) => void`
Invokes `changeText` event handler on the element or parent element in the tree.