From 973e76d87f00c48fa65a6f263a774733562733a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Thu, 8 Jan 2026 16:47:32 +0100 Subject: [PATCH] fixup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- plugins/catalog/src/alpha/pages.test.tsx | 12 ++-- .../GroupListPicker/GroupListPicker.test.tsx | 22 +++--- yarn.lock | 68 +++++++------------ 3 files changed, 42 insertions(+), 60 deletions(-) diff --git a/plugins/catalog/src/alpha/pages.test.tsx b/plugins/catalog/src/alpha/pages.test.tsx index 0b35e63979..2ce2095358 100644 --- a/plugins/catalog/src/alpha/pages.test.tsx +++ b/plugins/catalog/src/alpha/pages.test.tsx @@ -634,7 +634,7 @@ describe('Entity page', () => { Object.assign({ namespace: 'catalog' }, catalogEntityPage), ).add(menuItem); - renderInTestApp( + await renderInTestApp( { ); const { disabled } = params.useProps(); + await userEvent.click(await screen.findByTestId('menu-button')); + await waitFor(async () => { - await userEvent.click(screen.getByTestId('menu-button')); expect(screen.getByText('Test Title')).toBeInTheDocument(); expect(screen.getByText('Test Icon')).toBeInTheDocument(); const anchor = screen.getByText('Test Title').closest('a'); @@ -696,7 +697,7 @@ describe('Entity page', () => { Object.assign({ namespace: 'catalog' }, catalogEntityPage), ).add(menuItem); - renderInTestApp( + await renderInTestApp( { .add(menuItem) .add(filteredMenuItem); - renderInTestApp( + await renderInTestApp( { }, ); + await userEvent.click(await screen.findByTestId('menu-button')); + await waitFor(async () => { - await userEvent.click(screen.getByTestId('menu-button')); expect(screen.getByText('Should Render')).toBeInTheDocument(); expect( screen.queryByText('Should Not Render'), diff --git a/plugins/org-react/src/components/GroupListPicker/GroupListPicker.test.tsx b/plugins/org-react/src/components/GroupListPicker/GroupListPicker.test.tsx index eac96a5d14..6581b19467 100644 --- a/plugins/org-react/src/components/GroupListPicker/GroupListPicker.test.tsx +++ b/plugins/org-react/src/components/GroupListPicker/GroupListPicker.test.tsx @@ -14,13 +14,12 @@ * limitations under the License. */ -import { render, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; import { ApiProvider } from '@backstage/core-app-api'; import { catalogApiRef } from '@backstage/plugin-catalog-react'; import { GroupListPicker } from '../GroupListPicker'; import { GroupEntity } from '@backstage/catalog-model'; -import { TestApiRegistry } from '@backstage/test-utils'; +import { renderInTestApp, TestApiRegistry } from '@backstage/test-utils'; import { catalogApiMock } from '@backstage/plugin-catalog-react/testUtils'; const mockGroups: GroupEntity[] = [ @@ -64,7 +63,9 @@ const apis = TestApiRegistry.from([catalogApiRef, mockCatalogApi]); describe('', () => { it('can choose a group', async () => { - const { getByText, getByTestId } = render( + const user = userEvent.setup(); + + const { findByText, getByTestId } = await renderInTestApp( ', () => { , ); - await userEvent.click(getByTestId('group-list-picker-button')); - const input = getByTestId('group-list-picker-input').querySelector('input'); - await userEvent.type(input as HTMLElement, 'GR'); + await user.click(getByTestId('group-list-picker-button')); - await waitFor(async () => { - expect(getByText('Group A')).toBeInTheDocument(); - await userEvent.click(getByText('Group A')); - expect(getByText('Group A')).toBeInTheDocument(); - }); + const input = getByTestId('group-list-picker-input').querySelector('input'); + await user.type(input as HTMLElement, 'GR'); + + await user.click(await findByText('Group A')); + + await expect(findByText('Group A')).resolves.toBeInTheDocument(); }); }); diff --git a/yarn.lock b/yarn.lock index 8b2d1d94a5..ecf89d5a4c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9127,18 +9127,7 @@ __metadata: languageName: node linkType: hard -"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.7.0": - version: 4.9.0 - resolution: "@eslint-community/eslint-utils@npm:4.9.0" - dependencies: - eslint-visitor-keys: "npm:^3.4.3" - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 - checksum: 10/89b1eb3137e14c379865e60573f524fcc0ee5c4b0c7cd21090673e75e5a720f14b92f05ab2d02704c2314b67e67b6f96f3bb209ded6b890ced7b667aa4bf1fa2 - languageName: node - linkType: hard - -"@eslint-community/eslint-utils@npm:^4.9.1": +"@eslint-community/eslint-utils@npm:^4.2.0, @eslint-community/eslint-utils@npm:^4.4.0, @eslint-community/eslint-utils@npm:^4.7.0, @eslint-community/eslint-utils@npm:^4.9.1": version: 4.9.1 resolution: "@eslint-community/eslint-utils@npm:4.9.1" dependencies: @@ -22403,7 +22392,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/tsconfig-utils@npm:8.48.1, @typescript-eslint/tsconfig-utils@npm:^8.48.1": +"@typescript-eslint/tsconfig-utils@npm:8.48.1": version: 8.48.1 resolution: "@typescript-eslint/tsconfig-utils@npm:8.48.1" peerDependencies: @@ -22412,7 +22401,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/tsconfig-utils@npm:8.52.0, @typescript-eslint/tsconfig-utils@npm:^8.52.0": +"@typescript-eslint/tsconfig-utils@npm:8.52.0, @typescript-eslint/tsconfig-utils@npm:^8.48.1, @typescript-eslint/tsconfig-utils@npm:^8.52.0": version: 8.52.0 resolution: "@typescript-eslint/tsconfig-utils@npm:8.52.0" peerDependencies: @@ -22444,14 +22433,14 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:8.48.1, @typescript-eslint/types@npm:^8.48.1": +"@typescript-eslint/types@npm:8.48.1": version: 8.48.1 resolution: "@typescript-eslint/types@npm:8.48.1" checksum: 10/1aa1e3f25b429bcebd9eb45b5252d950f1b24dbc6014a47dff8d00547e2e1ac47f351846fb996b6ebd49da37a85394051d36191cbbbf2c431b8db9d95afd198d languageName: node linkType: hard -"@typescript-eslint/types@npm:8.52.0, @typescript-eslint/types@npm:^8.52.0": +"@typescript-eslint/types@npm:8.52.0, @typescript-eslint/types@npm:^8.48.1, @typescript-eslint/types@npm:^8.52.0": version: 8.52.0 resolution: "@typescript-eslint/types@npm:8.52.0" checksum: 10/05a630c5d25cce74d1bfa51027f1232f2e8a97a8f483ce0274e928373b4633cdf713be53eca39926f0372d52a3335f13786c7910d2edfd546a0cf1d66b3bcf51 @@ -22477,7 +22466,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.48.1, @typescript-eslint/typescript-estree@npm:^8.23.0": +"@typescript-eslint/typescript-estree@npm:8.48.1": version: 8.48.1 resolution: "@typescript-eslint/typescript-estree@npm:8.48.1" dependencies: @@ -22496,7 +22485,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:8.52.0": +"@typescript-eslint/typescript-estree@npm:8.52.0, @typescript-eslint/typescript-estree@npm:^8.23.0": version: 8.52.0 resolution: "@typescript-eslint/typescript-estree@npm:8.52.0" dependencies: @@ -22515,7 +22504,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:8.48.1, @typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/utils@npm:^8.8.1": +"@typescript-eslint/utils@npm:8.48.1": version: 8.48.1 resolution: "@typescript-eslint/utils@npm:8.48.1" dependencies: @@ -22530,21 +22519,7 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:^7.0.0": - version: 7.18.0 - resolution: "@typescript-eslint/utils@npm:7.18.0" - dependencies: - "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:7.18.0" - "@typescript-eslint/types": "npm:7.18.0" - "@typescript-eslint/typescript-estree": "npm:7.18.0" - peerDependencies: - eslint: ^8.56.0 - checksum: 10/f43fedb4f4d2e3836bdf137889449063a55c0ece74fdb283929cd376197b992313be8ef4df920c1c801b5c3076b92964c84c6c3b9b749d263b648d0011f5926e - languageName: node - linkType: hard - -"@typescript-eslint/utils@npm:^8.51.0": +"@typescript-eslint/utils@npm:^6.0.0 || ^7.0.0 || ^8.0.0, @typescript-eslint/utils@npm:^8.51.0, @typescript-eslint/utils@npm:^8.8.1": version: 8.52.0 resolution: "@typescript-eslint/utils@npm:8.52.0" dependencies: @@ -22559,6 +22534,20 @@ __metadata: languageName: node linkType: hard +"@typescript-eslint/utils@npm:^7.0.0": + version: 7.18.0 + resolution: "@typescript-eslint/utils@npm:7.18.0" + dependencies: + "@eslint-community/eslint-utils": "npm:^4.4.0" + "@typescript-eslint/scope-manager": "npm:7.18.0" + "@typescript-eslint/types": "npm:7.18.0" + "@typescript-eslint/typescript-estree": "npm:7.18.0" + peerDependencies: + eslint: ^8.56.0 + checksum: 10/f43fedb4f4d2e3836bdf137889449063a55c0ece74fdb283929cd376197b992313be8ef4df920c1c801b5c3076b92964c84c6c3b9b749d263b648d0011f5926e + languageName: node + linkType: hard + "@typescript-eslint/visitor-keys@npm:7.18.0": version: 7.18.0 resolution: "@typescript-eslint/visitor-keys@npm:7.18.0" @@ -48492,16 +48481,7 @@ __metadata: languageName: node linkType: hard -"ts-api-utils@npm:^2.1.0": - version: 2.1.0 - resolution: "ts-api-utils@npm:2.1.0" - peerDependencies: - typescript: ">=4.8.4" - checksum: 10/02e55b49d9617c6eebf8aadfa08d3ca03ca0cd2f0586ad34117fdfc7aa3cd25d95051843fde9df86665ad907f99baed179e7a117b11021417f379e4d2614eacd - languageName: node - linkType: hard - -"ts-api-utils@npm:^2.4.0": +"ts-api-utils@npm:^2.1.0, ts-api-utils@npm:^2.4.0": version: 2.4.0 resolution: "ts-api-utils@npm:2.4.0" peerDependencies: