From 1ed4c799978198c4d25c04ed2d29bc171f62ecf9 Mon Sep 17 00:00:00 2001 From: Christos Nasikas Date: Tue, 26 Nov 2024 12:39:01 +0200 Subject: [PATCH] Fix types --- .../src/common/hooks/use_search_alerts_query.test.tsx | 4 ++-- .../public/application/hooks/use_load_alert_summary.test.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/kbn-alerts-ui-shared/src/common/hooks/use_search_alerts_query.test.tsx b/packages/kbn-alerts-ui-shared/src/common/hooks/use_search_alerts_query.test.tsx index 8d8e1a3694fba..c3ccf7528b9e1 100644 --- a/packages/kbn-alerts-ui-shared/src/common/hooks/use_search_alerts_query.test.tsx +++ b/packages/kbn-alerts-ui-shared/src/common/hooks/use_search_alerts_query.test.tsx @@ -127,11 +127,11 @@ describe('useSearchAlertsQuery', () => { }); it('calls searchAlerts with correct arguments', async () => { - const { result, waitForValueToChange } = renderHook(() => useSearchAlertsQuery(params), { + const { result } = renderHook(() => useSearchAlertsQuery(params), { wrapper, }); - await waitForValueToChange(() => result.current.data); + await waitFor(() => expect(result.current.data).toBeDefined()); expect(mockDataPlugin.search.search).toHaveBeenCalledWith( { diff --git a/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_load_alert_summary.test.ts b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_load_alert_summary.test.ts index b48e02be362ba..b21439038cd72 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_load_alert_summary.test.ts +++ b/x-pack/plugins/triggers_actions_ui/public/application/hooks/use_load_alert_summary.test.ts @@ -5,7 +5,7 @@ * 2.0. */ -import { waitFor, renderHook } from '@testing-library/react-hooks'; +import { waitFor, renderHook } from '@testing-library/react'; import { useKibana } from '../../common/lib/kibana'; import { mockedAlertSummaryResponse,