From 960b292c6878b905598cae0109c3724c01f6f431 Mon Sep 17 00:00:00 2001 From: Rik Claessens Date: Sat, 13 Jul 2024 11:31:09 +0200 Subject: [PATCH] Replace renderWithEffects with renderInTestApp to fix all existing tests Signed-off-by: Rik Claessens --- .../components/SearchBar/SearchBar.test.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx b/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx index 6fcb3ef987..bdff7ba57c 100644 --- a/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx +++ b/plugins/search-react/src/components/SearchBar/SearchBar.test.tsx @@ -22,7 +22,7 @@ import { ConfigReader } from '@backstage/core-app-api'; import { MockAnalyticsApi, TestApiProvider, - renderWithEffects, + renderInTestApp, } from '@backstage/test-utils'; import { searchApiRef } from '../../api'; import { SearchContextProvider } from '../../context'; @@ -61,7 +61,7 @@ describe('SearchBar', () => { }); it('Renders without exploding', async () => { - await renderWithEffects( + await renderInTestApp( { it('Renders with custom label', async () => { const label = 'label'; - await renderWithEffects( + await renderInTestApp( { it('Renders with custom placeholder', async () => { const placeholder = 'placeholder'; - await renderWithEffects( + await renderInTestApp( { it('Renders based on initial search', async () => { const term = 'term'; - await renderWithEffects( + await renderInTestApp( { it('Updates term state when text is entered', async () => { jest.useFakeTimers(); - await renderWithEffects( + await renderInTestApp( { it('Clear button clears term state', async () => { const term = 'term'; - await renderWithEffects( + await renderInTestApp( { it('Should not show clear button', async () => { const term = 'term'; - await renderWithEffects( + await renderInTestApp( { const debounceTime = 100; - await renderWithEffects( + await renderInTestApp( { it('Does not capture analytics event if not enabled in app', async () => { const analyticsApiMock = new MockAnalyticsApi(); - await renderWithEffects( + await renderInTestApp(