Skip to content

Commit

Permalink
Add delay in docs for loading state testing
Browse files Browse the repository at this point in the history
Following the discussion in apollographql#11285.
  • Loading branch information
gzm0 committed Oct 13, 2023
1 parent 2e6a6e2 commit c585e90
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/source/development-testing/testing.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ We can use the asynchronous `screen.findByText` method to query the DOM elements
```jsx
it("should render dog", async () => {
const dogMock = {
delay: 30 // to prevent React from batching the loading state away
// delay: Infinity // if you only want to test the loading state

request: {
query: GET_DOG_QUERY,
variables: { name: "Buck" }
Expand Down

0 comments on commit c585e90

Please sign in to comment.