66 */
77
88import { DataLoadingState } from '@kbn/unified-data-table' ;
9- import { act , waitFor , renderHook } from '@testing-library/react' ;
9+ import { act , renderHook } from '@testing-library/react-hooks ' ;
1010import type { TimelineArgs , UseTimelineEventsProps } from '.' ;
1111import * as useTimelineEventsModule from '.' ;
1212import { SecurityPageName } from '../../../common/constants' ;
@@ -16,6 +16,7 @@ import { useRouteSpy } from '../../common/utils/route/use_route_spy';
1616import { useFetchNotes } from '../../notes/hooks/use_fetch_notes' ;
1717import { useKibana } from '../../common/lib/kibana' ;
1818import { getMockTimelineSearchSubscription } from '../../common/mock/mock_timeline_search_service' ;
19+ import { waitFor } from '@testing-library/dom' ;
1920
2021const { initSortDefault, useTimelineEvents } = useTimelineEventsModule ;
2122
@@ -154,7 +155,7 @@ describe('useTimelineEventsHandler', () => {
154155 } ) ;
155156
156157 test ( 'should make events search request correctly' , async ( ) => {
157- const { result } = renderHook < [ DataLoadingState , TimelineArgs ] , UseTimelineEventsProps > (
158+ const { result } = renderHook < UseTimelineEventsProps , [ DataLoadingState , TimelineArgs ] > (
158159 ( args ) => useTimelineEvents ( args ) ,
159160 {
160161 initialProps : props ,
@@ -188,8 +189,8 @@ describe('useTimelineEventsHandler', () => {
188189
189190 test ( 'should mock cache for active timeline when switching page' , async ( ) => {
190191 const { result, rerender } = renderHook <
191- [ DataLoadingState , TimelineArgs ] ,
192- UseTimelineEventsProps
192+ UseTimelineEventsProps ,
193+ [ DataLoadingState , TimelineArgs ]
193194 > ( ( args ) => useTimelineEvents ( args ) , {
194195 initialProps : props ,
195196 } ) ;
@@ -231,8 +232,8 @@ describe('useTimelineEventsHandler', () => {
231232
232233 test ( 'Correlation pagination is calling search strategy when switching page' , async ( ) => {
233234 const { result, rerender } = renderHook <
234- [ DataLoadingState , TimelineArgs ] ,
235- UseTimelineEventsProps
235+ UseTimelineEventsProps ,
236+ [ DataLoadingState , TimelineArgs ]
236237 > ( ( args ) => useTimelineEvents ( args ) , {
237238 initialProps : {
238239 ...props ,
0 commit comments