From a31a1b0cecf1692b6c0a1f1e6c1d6b9b28e88323 Mon Sep 17 00:00:00 2001 From: Ismail Ghallou Date: Tue, 16 Jul 2019 18:47:24 +0100 Subject: [PATCH] update Example to match the one on the docs --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d6910e9..1d94b0e 100644 --- a/README.md +++ b/README.md @@ -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(''); @@ -92,7 +92,7 @@ function Example() { } test('examples of some things', async () => { - const { getByTestId, getByText, queryByTestId } = render(); + const { getByTestId, getByText, queryByTestId, baseElement } = render(); const famousWomanInHistory = 'Ada Lovelace'; const input = getByTestId('input'); @@ -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(); }); ```