File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -117,21 +117,21 @@ const expectation = nock('http://example.com')
117117
118118(Notice the ` .persist() ` , because we'll be calling from this endpoint multiple times)
119119
120- Now we can safely run our tests, the trick here is to await both ` isFetching ` and then ` !isFetching ` after calling ` fetchMore ()` :
120+ Now we can safely run our tests, the trick here is to await both ` isFetching ` and then ` !isFetching ` after calling ` fetchNextPage ()` :
121121
122122```
123123const { result, waitFor } = renderHook(() => useInfiniteQueryCustomHook(), { wrapper });
124124
125125await waitFor(() => result.current.isSuccess);
126126
127- expect(result.current.data).toStrictEqual(generateMockedResponse(1));
127+ expect(result.current.data.pages ).toStrictEqual(generateMockedResponse(1));
128128
129129result.current.fetchNextPage();
130130
131131await waitFor(() => result.current.isFetching);
132132await waitFor(() => !result.current.isFetching);
133133
134- expect(result.current.data).toStrictEqual([
134+ expect(result.current.data.pages ).toStrictEqual([
135135 ...generateMockedResponse(1),
136136 ...generateMockedResponse(2),
137137]);
You can’t perform that action at this time.
0 commit comments