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

update Example to match the one on the docs #43

Merged
merged 1 commit into from
Jul 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ still accounting for the differences in the platforms.
```javascript
import React from 'react';
import { Button, Text, TextInput, View } from 'react-native';
import { act, fireEvent, render, wait } from '@testing-library/react-native';
import { fireEvent, render, wait } from '@testing-library/react-native';

function Example() {
const [name, setUser] = React.useState('');
Expand All @@ -92,7 +92,7 @@ function Example() {
}

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

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

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

expect(getByTestId('printed-username')).toHaveTextContent(famousWomanInHistory);
expect(rootInstance).toMatchSnapshot();
expect(getByTestId('printed-username').props.children).toBe(famousWomanInHistory);
expect(baseElement).toMatchSnapshot();
});
```

Expand Down