File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
apps/meteor/client/components/Omnichannel/hooks Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,11 @@ it('should fetch business units', async () => {
37
37
38
38
const { result } = renderHook ( ( ) => useUnitsList ( { filter : '' , limit } ) , { wrapper : appRoot . build ( ) } ) ;
39
39
40
- expect ( result . current . isFetching ) . toBe ( true ) ;
41
- await waitFor ( ( ) => expect ( result . current . isFetching ) . toBe ( false ) ) ;
42
-
43
- expect ( mockGetUnits ) . toHaveBeenCalled ( ) ;
44
- expect ( result . current . data ) . toEqual ( data . slice ( 0 , 5 ) . map ( formatUnitItem ) ) ;
40
+ await waitFor ( ( ) => expect ( result . current . data ) . toEqual ( data . slice ( 0 , 5 ) . map ( formatUnitItem ) ) ) ;
45
41
46
42
await act ( ( ) => result . current . fetchNextPage ( ) ) ;
47
43
48
- expect ( mockGetUnits ) . toHaveBeenCalledTimes ( 2 ) ;
49
- await waitFor ( ( ) => expect ( result . current . data ) . toHaveLength ( 10 ) ) ;
50
- expect ( result . current . data ) . toEqual ( data . map ( formatUnitItem ) ) ;
44
+ await waitFor ( ( ) => expect ( result . current . data ) . toEqual ( data . map ( formatUnitItem ) ) ) ;
51
45
52
46
await act ( ( ) => result . current . fetchNextPage ( ) ) ;
53
47
You can’t perform that action at this time.
0 commit comments