Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit deb82b3

Browse files
smakoshbcarroll22
authored andcommitted
docs: update README example to match the docs site (#43)
Closes #42
1 parent 0e22db2 commit deb82b3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ still accounting for the differences in the platforms.
6767
```javascript
6868
import React from 'react';
6969
import { Button, Text, TextInput, View } from 'react-native';
70-
import { act, fireEvent, render, wait } from '@testing-library/react-native';
70+
import { fireEvent, render, wait } from '@testing-library/react-native';
7171

7272
function Example() {
7373
const [name, setUser] = React.useState('');
@@ -92,7 +92,7 @@ function Example() {
9292
}
9393

9494
test('examples of some things', async () => {
95-
const { getByTestId, getByText, queryByTestId } = render(<Example />);
95+
const { getByTestId, getByText, queryByTestId, baseElement } = render(<Example />);
9696
const famousWomanInHistory = 'Ada Lovelace';
9797

9898
const input = getByTestId('input');
@@ -103,8 +103,8 @@ test('examples of some things', async () => {
103103

104104
await wait(() => expect(queryByTestId('printed-username')).toBeTruthy());
105105

106-
expect(getByTestId('printed-username')).toHaveTextContent(famousWomanInHistory);
107-
expect(rootInstance).toMatchSnapshot();
106+
expect(getByTestId('printed-username').props.children).toBe(famousWomanInHistory);
107+
expect(baseElement).toMatchSnapshot();
108108
});
109109
```
110110

0 commit comments

Comments
 (0)