Skip to content

Commit

Permalink
useDocuments.test.tsx: wrap change in act() to make warnings go away
Browse files Browse the repository at this point in the history
  • Loading branch information
HerbCaudill committed Feb 29, 2024
1 parent 6cd453c commit a421656
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions packages/automerge-repo-react-hooks/test/useDocuments.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ describe("useDocuments", () => {
documentIds.forEach((id, i) => expect(documents[id]).toEqual({ foo: i }))
})

// multiply the value of foo in each document by 10
documentIds.forEach(id => {
const handle = repo.find(id)
handle.change(s => (s.foo *= 10))
act(() => {
// multiply the value of foo in each document by 10
documentIds.forEach(id => {
const handle = repo.find(id)
handle.change(s => (s.foo *= 10))
})
})

await waitFor(() => {
Expand Down

0 comments on commit a421656

Please sign in to comment.