From ecb26c1fed0cbfc3d1765cd5f7280c3128c88b0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Tue, 24 Mar 2020 17:10:48 +0100 Subject: [PATCH] Update template tests (#8705) --- packages/cra-template-typescript/template/src/App.test.tsx | 6 +++--- packages/cra-template/template/src/App.test.js | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cra-template-typescript/template/src/App.test.tsx b/packages/cra-template-typescript/template/src/App.test.tsx index 4db7ebc25c2..2a68616d984 100644 --- a/packages/cra-template-typescript/template/src/App.test.tsx +++ b/packages/cra-template-typescript/template/src/App.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import App from './App'; test('renders learn react link', () => { - const { getByText } = render(); - const linkElement = getByText(/learn react/i); + render(); + const linkElement = screen.getByText(/learn react/i); expect(linkElement).toBeInTheDocument(); }); diff --git a/packages/cra-template/template/src/App.test.js b/packages/cra-template/template/src/App.test.js index 4db7ebc25c2..2a68616d984 100644 --- a/packages/cra-template/template/src/App.test.js +++ b/packages/cra-template/template/src/App.test.js @@ -1,9 +1,9 @@ import React from 'react'; -import { render } from '@testing-library/react'; +import { render, screen } from '@testing-library/react'; import App from './App'; test('renders learn react link', () => { - const { getByText } = render(); - const linkElement = getByText(/learn react/i); + render(); + const linkElement = screen.getByText(/learn react/i); expect(linkElement).toBeInTheDocument(); });