Skip to content

Commit 856567a

Browse files
committed
fix flaky test
1 parent 662d093 commit 856567a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

packages/keycloak-user-management/src/components/forms/UserForm/tests/index.unmocked.test.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import {
1919
fireEvent,
2020
render,
2121
waitFor,
22-
waitForElementToBeRemoved,
2322
within,
2423
} from '@testing-library/react';
2524
import userEvent from '@testing-library/user-event';
@@ -206,7 +205,10 @@ describe('forms/userForm', () => {
206205
// simulate click on select - to show dropdown items
207206
fireEvent.mouseDown(appIdInput);
208207

209-
await waitForElementToBeRemoved(appIdSection.querySelector('.anticon-spin'));
208+
// Wait for dropdown options to load
209+
await waitFor(() => {
210+
expect(document.querySelector('div#fhirCoreAppId_list + .rc-virtual-list')).toBeTruthy();
211+
});
210212
const appIdOptionList = document.querySelector(
211213
'div#fhirCoreAppId_list + .rc-virtual-list'
212214
) as Element;

0 commit comments

Comments
 (0)