From c4e02b1a9f2d2c8ba22ad9d025662115010fe729 Mon Sep 17 00:00:00 2001 From: Jordan Thomson Date: Tue, 10 Dec 2024 12:05:04 +1100 Subject: [PATCH] removed legacy test --- .../__tests__/observer.test.tsx | 34 +------------------ 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/packages/mobx-react-lite/__tests__/observer.test.tsx b/packages/mobx-react-lite/__tests__/observer.test.tsx index 607e5d21d..7f3afda91 100644 --- a/packages/mobx-react-lite/__tests__/observer.test.tsx +++ b/packages/mobx-react-lite/__tests__/observer.test.tsx @@ -49,7 +49,7 @@ function runTestSuite(mode: "observer" | "useObserver") { list: 0 } - const TodoItem = obsComponent(({ todo }: { todo: typeof store.todos[0] }) => { + const TodoItem = obsComponent(({ todo }: { todo: (typeof store.todos)[0] }) => { renderings.item++ return
  • |{todo.title}
  • }, true) @@ -997,38 +997,6 @@ it("dependencies should not become temporarily unobserved", async () => { expect(doubleDisposed).toBeCalledTimes(1) }) -it("Legacy context support", () => { - const contextKey = "key" - const contextValue = "value" - - function ContextConsumer(_, context) { - expect(context[contextKey]).toBe(contextValue) - return null - } - - ContextConsumer.contextTypes = { - [contextKey]: () => null - } - - const ObserverContextConsumer = observer(ContextConsumer) - - class ContextProvider extends React.Component { - getChildContext() { - return { [contextKey]: contextValue } - } - - render() { - return - } - } - - ;(ContextProvider as any).childContextTypes = { - [contextKey]: () => null - } - - render() -}) - it("Throw when trying to set contextType on observer", () => { const NamedObserver = observer(function TestCmp() { return null