Skip to content

Commit 70ce58b

Browse files
committed
feat(useQuery): add reset method to returned useQuery object
adapt existing tests
1 parent 39cc89c commit 70ce58b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/react/tests/useInfiniteQuery.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ describe('useInfiniteQuery', () => {
9191
isSuccess: false,
9292
refetch: expect.any(Function),
9393
remove: expect.any(Function),
94+
reset: expect.any(Function),
9495
status: 'loading',
9596
})
9697

@@ -120,6 +121,7 @@ describe('useInfiniteQuery', () => {
120121
isSuccess: true,
121122
refetch: expect.any(Function),
122123
remove: expect.any(Function),
124+
reset: expect.any(Function),
123125
status: 'success',
124126
})
125127
})

src/react/tests/useQuery.test.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ describe('useQuery', () => {
182182
isSuccess: false,
183183
refetch: expect.any(Function),
184184
remove: expect.any(Function),
185+
reset: expect.any(Function),
185186
status: 'loading',
186187
})
187188

@@ -205,6 +206,7 @@ describe('useQuery', () => {
205206
isSuccess: true,
206207
refetch: expect.any(Function),
207208
remove: expect.any(Function),
209+
reset: expect.any(Function),
208210
status: 'success',
209211
})
210212
})
@@ -258,6 +260,7 @@ describe('useQuery', () => {
258260
isSuccess: false,
259261
refetch: expect.any(Function),
260262
remove: expect.any(Function),
263+
reset: expect.any(Function),
261264
status: 'loading',
262265
})
263266

@@ -281,6 +284,7 @@ describe('useQuery', () => {
281284
isSuccess: false,
282285
refetch: expect.any(Function),
283286
remove: expect.any(Function),
287+
reset: expect.any(Function),
284288
status: 'loading',
285289
})
286290

@@ -304,6 +308,7 @@ describe('useQuery', () => {
304308
isSuccess: false,
305309
refetch: expect.any(Function),
306310
remove: expect.any(Function),
311+
reset: expect.any(Function),
307312
status: 'error',
308313
})
309314

0 commit comments

Comments
 (0)