From a421656f680d601441a60fa9e57897abbac46268 Mon Sep 17 00:00:00 2001 From: Herb Caudill Date: Thu, 29 Feb 2024 12:26:15 +0100 Subject: [PATCH] useDocuments.test.tsx: wrap change in `act()` to make warnings go away --- .../test/useDocuments.test.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/automerge-repo-react-hooks/test/useDocuments.test.tsx b/packages/automerge-repo-react-hooks/test/useDocuments.test.tsx index 7117e8863..bfd57d292 100644 --- a/packages/automerge-repo-react-hooks/test/useDocuments.test.tsx +++ b/packages/automerge-repo-react-hooks/test/useDocuments.test.tsx @@ -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(() => {