Skip to content

Commit 32b1f7d

Browse files
committed
Replace waitFor with findBy in tests
1 parent 55c5526 commit 32b1f7d

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/platform/packages/shared/response-ops/recurring-schedule-form/components/custom_recurring_schedule.test.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
import React, { PropsWithChildren } from 'react';
11-
import { fireEvent, render, waitFor, within, screen } from '@testing-library/react';
11+
import { fireEvent, render, within, screen } from '@testing-library/react';
1212
import { useForm, Form } from '@kbn/es-ui-shared-plugin/static/forms/hook_form_lib';
1313
import { Frequency } from '@kbn/rrule';
1414
import type { RecurringSchedule } from '../types';
@@ -70,7 +70,7 @@ describe('CustomRecurringSchedule', () => {
7070
target: { value: Frequency.WEEKLY },
7171
}
7272
);
73-
await waitFor(() => expect(screen.getByTestId('byweekday-field')).toBeInTheDocument());
73+
expect(await screen.findByTestId('byweekday-field')).toBeInTheDocument();
7474
});
7575

7676
it('renders byweekday field if frequency = daily', async () => {
@@ -105,7 +105,7 @@ describe('CustomRecurringSchedule', () => {
105105
target: { value: Frequency.MONTHLY },
106106
}
107107
);
108-
await waitFor(() => expect(screen.getByTestId('bymonth-field')).toBeInTheDocument());
108+
expect(await screen.findByTestId('bymonth-field')).toBeInTheDocument();
109109
});
110110

111111
it('should initialize the form when no initialValue provided', () => {

0 commit comments

Comments
 (0)