@tanstack/react-query-persist-client 5.0.0-alpha.59 → 5.0.0-alpha.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -303,10 +303,13 @@ describe('PersistQueryClientProvider', () => {
|
|
|
303
303
|
|
|
304
304
|
queryClient.clear()
|
|
305
305
|
|
|
306
|
+
let fetched = false
|
|
307
|
+
|
|
306
308
|
function Page() {
|
|
307
309
|
const state = useQuery({
|
|
308
310
|
queryKey: key,
|
|
309
311
|
queryFn: async () => {
|
|
312
|
+
fetched = true
|
|
310
313
|
await sleep(10)
|
|
311
314
|
return 'fetched'
|
|
312
315
|
},
|
|
@@ -336,7 +339,9 @@ describe('PersistQueryClientProvider', () => {
|
|
|
336
339
|
await waitFor(() => rendered.getByText('data: null'))
|
|
337
340
|
await waitFor(() => rendered.getByText('data: hydrated'))
|
|
338
341
|
|
|
339
|
-
expect(states).toHaveLength(
|
|
342
|
+
expect(states).toHaveLength(3)
|
|
343
|
+
|
|
344
|
+
expect(fetched).toBe(false)
|
|
340
345
|
|
|
341
346
|
expect(states[0]).toMatchObject({
|
|
342
347
|
status: 'pending',
|
|
@@ -349,6 +354,9 @@ describe('PersistQueryClientProvider', () => {
|
|
|
349
354
|
fetchStatus: 'idle',
|
|
350
355
|
data: 'hydrated',
|
|
351
356
|
})
|
|
357
|
+
|
|
358
|
+
// #5443 seems like we get an extra render now ...
|
|
359
|
+
expect(states[1]).toStrictEqual(states[2])
|
|
352
360
|
})
|
|
353
361
|
|
|
354
362
|
test('should call onSuccess after successful restoring', async () => {
|