Skip to content

Commit bf4c02c

Browse files
authored
Merge pull request #299 from automerge/use-documents-fix-react-act-warnings
Fix React warnings in `useDocuments` tests
2 parents 8bcba03 + a421656 commit bf4c02c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/automerge-repo-react-hooks/test/useDocuments.test.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,12 @@ describe("useDocuments", () => {
5656
documentIds.forEach((id, i) => expect(documents[id]).toEqual({ foo: i }))
5757
})
5858

59-
// multiply the value of foo in each document by 10
60-
documentIds.forEach(id => {
61-
const handle = repo.find(id)
62-
handle.change(s => (s.foo *= 10))
59+
act(() => {
60+
// multiply the value of foo in each document by 10
61+
documentIds.forEach(id => {
62+
const handle = repo.find(id)
63+
handle.change(s => (s.foo *= 10))
64+
})
6365
})
6466

6567
await waitFor(() => {

0 commit comments

Comments
 (0)