diff --git a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx
index 2618fab57a..ea3ea3e96f 100644
--- a/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx
+++ b/plugins/catalog-import/src/components/StepPrepareCreatePullRequest/PreviewCatalogInfoComponent.test.tsx
@@ -16,7 +16,7 @@
import { Entity } from '@backstage/catalog-model';
import { makeStyles } from '@material-ui/core';
-import { render } from '@testing-library/react';
+import { render, screen } from '@testing-library/react';
import { renderHook } from '@testing-library/react-hooks';
import React from 'react';
import { PreviewCatalogInfoComponent } from './PreviewCatalogInfoComponent';
@@ -46,15 +46,17 @@ const entities: Entity[] = [
describe('', () => {
it('renders without exploding', async () => {
- const { getByText, findByText } = render(
+ render(
,
);
- const repositoryUrl = getByText('http://my-repository/a/catalog-info.yaml');
- const kindText = await findByText('Kind_2');
+ const repositoryUrl = screen.getByText(
+ 'http://my-repository/a/catalog-info.yaml',
+ );
+ const kindText = await screen.findByText('Kind_2');
expect(repositoryUrl).toBeInTheDocument();
expect(repositoryUrl).toBeVisible();
expect(kindText).toBeInTheDocument();
@@ -64,7 +66,7 @@ describe('', () => {
it('renders card with custom styles', async () => {
const { result } = renderHook(() => useStyles());
- const { getByText } = render(
+ render(
', () => {
/>,
);
- const repositoryUrl = getByText('http://my-repository/a/catalog-info.yaml');
- const kindText = getByText('Kind_2');
+ const repositoryUrl = screen.getByText(
+ 'http://my-repository/a/catalog-info.yaml',
+ );
+ const kindText = await screen.findByText('Kind_2');
expect(repositoryUrl).toBeInTheDocument();
expect(repositoryUrl).not.toBeVisible();
expect(kindText).toBeInTheDocument();
@@ -83,7 +87,7 @@ describe('', () => {
it('renders with custom styles', async () => {
const { result } = renderHook(() => useStyles());
- const { getByText } = render(
+ render(
', () => {
/>,
);
- const repositoryUrl = getByText('http://my-repository/a/catalog-info.yaml');
- const kindText = getByText('Kind_2');
+ const repositoryUrl = screen.getByText(
+ 'http://my-repository/a/catalog-info.yaml',
+ );
+ const kindText = await screen.findByText('Kind_2');
expect(repositoryUrl).toBeInTheDocument();
expect(repositoryUrl).toBeVisible();
expect(kindText).toBeInTheDocument();