Skip to content

Commit

Permalink
use waitFor in place of act
Browse files Browse the repository at this point in the history
  • Loading branch information
eokoneyo committed Nov 27, 2024
1 parent 90d71d5 commit 9d5675d
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -64,7 +64,7 @@ describe('AgentlessEnrollmentFlyout', () => {
const { getByText } = renderer.render(
<AgentlessEnrollmentFlyout onClose={onClose} packagePolicy={packagePolicy} />
);
await act(async () => {
await waitFor(async () => {
expect(getByText('Confirm agentless enrollment')).toBeInTheDocument();
expect(getByText('Step 1 is loading')).toBeInTheDocument();
expect(
Expand Down

0 comments on commit 9d5675d

Please sign in to comment.