Skip to content

Commit

Permalink
tests: fix suspense test
Browse files Browse the repository at this point in the history
  • Loading branch information
tannerlinsley committed Jul 1, 2020
1 parent 639dd9b commit cee6175
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ jobs:
registry-url: https://registry.npmjs.org/
- run: npm i -g yarn
- run: yarn --frozen-lockfile
- run: yarn build
- run: npx semantic-release@17
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
Expand Down
7 changes: 4 additions & 3 deletions src/react/tests/suspense.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ describe("useQuery's in Suspense mode", () => {

const rendered = render(
<ErrorBoundary
onReset={queryCache.resetErrorBoundaries}
fallbackRender={({ resetErrorBoundary }) => (
<div>
<div>error boundary</div>
Expand All @@ -143,13 +144,13 @@ describe("useQuery's in Suspense mode", () => {

await waitFor(() => rendered.getByText('error boundary'))

await act(() => sleep(11))
await waitFor(() => rendered.getByText('retry'))

fireEvent.click(rendered.getByText('retry'))

console.error.mockRestore()

await waitFor(() => rendered.getByText('rendered'))

console.error.mockRestore()
})

it('should not call the queryFn when not enabled', async () => {
Expand Down

0 comments on commit cee6175

Please sign in to comment.