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();
});