diff --git a/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/index.test.tsx b/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/index.test.tsx index ef3eb2b0da3cb..408105558db2c 100644 --- a/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/index.test.tsx +++ b/x-pack/plugins/fleet/public/components/agentless_enrollment_flyout/index.test.tsx @@ -5,7 +5,7 @@ * 2.0. */ import React from 'react'; -import { act, waitFor } from '@testing-library/react'; +import { waitFor } from '@testing-library/react'; import { sendGetAgents, useGetPackageInfoByKeyQuery } from '../../hooks'; import { usePollingIncomingData } from '../agent_enrollment_flyout/use_get_agent_incoming_data'; @@ -64,7 +64,7 @@ describe('AgentlessEnrollmentFlyout', () => { const { getByText } = renderer.render( ); - await act(async () => { + await waitFor(async () => { expect(getByText('Confirm agentless enrollment')).toBeInTheDocument(); expect(getByText('Step 1 is loading')).toBeInTheDocument(); expect(