From 6e5f5ed3bd56ce18ebb04c38ef00814e1a4e7bb6 Mon Sep 17 00:00:00 2001
From: "Eyo O. Eyo" <7893459+eokoneyo@users.noreply.github.com>
Date: Wed, 27 Nov 2024 13:10:59 +0100
Subject: [PATCH] use waitFor in place of act (#201921)
## Summary
Fixes incorrect usage of act for assertions. Informed from
https://buildkite.com/elastic/kibana-pull-request/builds/254649#019369dd-02e4-4d1e-9c45-face1da80884
### Before
## After
---
.../components/agentless_enrollment_flyout/index.test.tsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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(