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 @@ -38,17 +38,11 @@ it('should fetch tags', async () => {
38
38
39
39
const { result } = renderHook ( ( ) => useTagsList ( { filter : '' , limit } ) , { wrapper : appRoot . build ( ) } ) ;
40
40
41
- expect ( result . current . isFetching ) . toBe ( true ) ;
42
- await waitFor ( ( ) => expect ( result . current . isFetching ) . toBe ( false ) ) ;
43
-
44
- expect ( mockGetTags ) . toHaveBeenCalled ( ) ;
45
- expect ( result . current . data ) . toEqual ( data . slice ( 0 , 5 ) . map ( formatTagItem ) ) ;
41
+ await waitFor ( ( ) => expect ( result . current . data ) . toEqual ( data . slice ( 0 , 5 ) . map ( formatTagItem ) ) ) ;
46
42
47
43
await act ( ( ) => result . current . fetchNextPage ( ) ) ;
48
44
49
- expect ( mockGetTags ) . toHaveBeenCalledTimes ( 2 ) ;
50
- await waitFor ( ( ) => expect ( result . current . data ) . toHaveLength ( 10 ) ) ;
51
- expect ( result . current . data ) . toEqual ( data . map ( formatTagItem ) ) ;
45
+ await waitFor ( ( ) => expect ( result . current . data ) . toEqual ( data . map ( formatTagItem ) ) ) ;
52
46
53
47
await act ( ( ) => result . current . fetchNextPage ( ) ) ;
54
48
You can’t perform that action at this time.
0 commit comments