From 80d60a2cde53904d55b27af837ff821b0dac5795 Mon Sep 17 00:00:00 2001 From: Eyo Okon Eyo Date: Thu, 21 Nov 2024 13:37:58 +0100 Subject: [PATCH] [React18] Migrated test suites to accommodate changes to testing library owned by fleet,kibana-cloud-security-posture --- .../single_page_layout/hooks/setup_technology.test.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.test.ts b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.test.ts index 82e4f80c9b271..0953f2367d05c 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.test.ts +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/agent_policy/create_package_policy_page/single_page_layout/hooks/setup_technology.test.ts @@ -5,9 +5,7 @@ * 2.0. */ -import { renderHook, act } from '@testing-library/react-hooks/dom'; - -import { waitFor } from '@testing-library/react'; +import { waitFor, renderHook, act } from '@testing-library/react'; import { createPackagePolicyMock } from '../../../../../../../../common/mocks'; @@ -580,9 +578,9 @@ describe('useSetupTechnology', () => { }) ); - await waitFor(() => new Promise((resolve) => resolve(null))); - - expect(result.current.selectedSetupTechnology).toBe(SetupTechnology.AGENT_BASED); + await waitFor(() => + expect(result.current.selectedSetupTechnology).toBe(SetupTechnology.AGENT_BASED) + ); act(() => { result.current.handleSetupTechnologyChange(SetupTechnology.AGENT_BASED);