Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/react-query/src/__tests__/useQuery.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6581,6 +6581,7 @@ describe('useQuery', () => {
defaultOptions: { hydrate: { queries: { retry: 1, retryDelay: 10 } } },
})
hydrate(clientQueryClient, dehydrated)
await sleep(400)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing the fetch to fail before rendering, which means the client can immediately retry on rendering, putting the query in a fetching state, so the redacted will never get printed to the DOM.

If you instead inspect the queryCache directly, it's there.
If you instead put the await between the two waitFor below, the test succeeds again.

So while this might have surfaced an unhandled error in the past, the actual test fail seems to be unrelated.


const rendered = renderWithClient(clientQueryClient, <Page />)
await waitFor(() => rendered.getByText('failure: redacted'))
Expand Down