From 76806b265b1f4ffbdc4b29fd90ec2814d6ea544f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Pla=C4=8Dek?= <11457665+urugator@users.noreply.github.com> Date: Sun, 29 Oct 2023 10:12:24 +0100 Subject: [PATCH] remove incorrect test --- .../mobx-react/__tests__/observer.test.tsx | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/packages/mobx-react/__tests__/observer.test.tsx b/packages/mobx-react/__tests__/observer.test.tsx index d3f982766..5d5acaa8c 100644 --- a/packages/mobx-react/__tests__/observer.test.tsx +++ b/packages/mobx-react/__tests__/observer.test.tsx @@ -296,27 +296,6 @@ test("issue 12", () => { expect(events).toEqual(["table", "row: coffee", "row: tea", "table", "row: soup"]) }) -test("changing state in render should fail", () => { - const data = observable.box(2) - const Comp = observer(() => { - if (data.get() === 3) { - try { - data.set(4) // wouldn't throw first time for lack of observers.. (could we tighten this?) - } catch (err) { - expect(err).toBeInstanceOf(Error) - expect(err).toMatch( - /Side effects like changing state are not allowed at this point/ - ) - } - } - return
{data.get()}
- }) - render() - - act(() => data.set(3)) - _resetGlobalState() -}) - test("observer component can be injected", () => { const msg: Array = [] const baseWarn = console.warn