diff --git a/packages/core/src/components/Button/Button.test.jsx b/packages/core/src/components/Button/Button.test.jsx
index 5750f84101..115835be3f 100644
--- a/packages/core/src/components/Button/Button.test.jsx
+++ b/packages/core/src/components/Button/Button.test.jsx
@@ -24,7 +24,7 @@ describe('', () => {
it('navigates using react-router', async () => {
const testString = 'This is test string';
const buttonLabel = 'Navigate!';
- const { getByText, getByRole, ...all } = render(
+ const { getByText } = render(
wrapInTestApp(
{testString}
} />
@@ -34,7 +34,7 @@ describe('', () => {
);
expect(() => getByText(testString)).toThrow();
- await act(async () => fireEvent.click(getByRole('button')));
+ await act(async () => fireEvent.click(getByText(buttonLabel)));
expect(getByText(testString)).toBeInTheDocument();
});
});
diff --git a/packages/test-utils/src/testUtils/appWrappers.test.tsx b/packages/test-utils/src/testUtils/appWrappers.test.tsx
index 75fcbe4e04..19c02c2158 100644
--- a/packages/test-utils/src/testUtils/appWrappers.test.tsx
+++ b/packages/test-utils/src/testUtils/appWrappers.test.tsx
@@ -17,7 +17,7 @@
import React, { FC, useEffect } from 'react';
import { render } from '@testing-library/react';
import { wrapInTestApp, renderInTestApp } from './appWrappers';
-import { Route } from 'react-router';
+import { Route, Routes } from 'react-router';
import { withLogCollector } from '@backstage/test-utils-core';
import {
useApi,
@@ -32,11 +32,11 @@ describe('wrapInTestApp', () => {
const { error } = await withLogCollector(['error'], async () => {
const rendered = render(
wrapInTestApp(
- <>
+
Route 1} />
Route 2} />
- >,
- { routeEntries: ['/'] },
+ ,
+ { routeEntries: ['/route2'] },
),
);