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 3fe1890e75f72..919494d2aa7b1 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'; @@ -512,9 +510,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);