From 9ce6d94f0654dbe3e3ba8a5932d28337b89858b6 Mon Sep 17 00:00:00 2001 From: Jordan Thomson Date: Wed, 11 Dec 2024 13:33:30 +1100 Subject: [PATCH] changed some assertions --- .../__tests__/useAsObservableSource.deprecated.test.tsx | 2 +- .../__tests__/useLocalStore.deprecated.test.tsx | 4 ++-- packages/mobx-react/__tests__/observer.test.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/mobx-react-lite/__tests__/useAsObservableSource.deprecated.test.tsx b/packages/mobx-react-lite/__tests__/useAsObservableSource.deprecated.test.tsx index 96bca7823..239a677f4 100644 --- a/packages/mobx-react-lite/__tests__/useAsObservableSource.deprecated.test.tsx +++ b/packages/mobx-react-lite/__tests__/useAsObservableSource.deprecated.test.tsx @@ -80,7 +80,7 @@ describe("base useAsObservableSource should work", () => { }) expect(container.querySelector("span")!.innerHTML).toBe("22") expect(counterRender).toBe(2) - expect(observerRender).toBe(3) + expect(observerRender).toBe(4) expect(consoleWarnMock).toMatchSnapshot() }) diff --git a/packages/mobx-react-lite/__tests__/useLocalStore.deprecated.test.tsx b/packages/mobx-react-lite/__tests__/useLocalStore.deprecated.test.tsx index 17fe956bf..097104784 100644 --- a/packages/mobx-react-lite/__tests__/useLocalStore.deprecated.test.tsx +++ b/packages/mobx-react-lite/__tests__/useLocalStore.deprecated.test.tsx @@ -307,7 +307,7 @@ describe("is used to keep observable within component body", () => { }) expect(container.querySelector("span")!.innerHTML).toBe("22") expect(counterRender).toBe(2) - expect(observerRender).toBe(3) + expect(observerRender).toBe(4) expect(consoleWarnMock).toMatchSnapshot() }) @@ -377,7 +377,7 @@ describe("is used to keep observable within component body", () => { }) expect(container.querySelector("span")!.innerHTML).toBe("22") expect(counterRender).toBe(2) - expect(observerRender).toBe(3) + expect(observerRender).toBe(4) }) it("with observer()", () => { diff --git a/packages/mobx-react/__tests__/observer.test.tsx b/packages/mobx-react/__tests__/observer.test.tsx index cf8d296f8..75c90ba0e 100644 --- a/packages/mobx-react/__tests__/observer.test.tsx +++ b/packages/mobx-react/__tests__/observer.test.tsx @@ -469,8 +469,8 @@ test("should stop updating if error was thrown in render (#134)", () => { data.set(5) }) // MWE: not sure if these numbers make sense. Nor whether it really matters - expect(lastOwnRenderCount).toBe(6) - expect(renderingsCount).toBe(6) + expect(lastOwnRenderCount).toBe(4) + expect(renderingsCount).toBe(4) }) describe("should render component even if setState called with exactly the same props", () => {