Skip to content

Commit c4e02b1

Browse files
committed
removed legacy test
1 parent 461c5e7 commit c4e02b1

File tree

1 file changed

+1
-33
lines changed

1 file changed

+1
-33
lines changed

packages/mobx-react-lite/__tests__/observer.test.tsx

+1-33
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function runTestSuite(mode: "observer" | "useObserver") {
4949
list: 0
5050
}
5151

52-
const TodoItem = obsComponent(({ todo }: { todo: typeof store.todos[0] }) => {
52+
const TodoItem = obsComponent(({ todo }: { todo: (typeof store.todos)[0] }) => {
5353
renderings.item++
5454
return <li>|{todo.title}</li>
5555
}, true)
@@ -997,38 +997,6 @@ it("dependencies should not become temporarily unobserved", async () => {
997997
expect(doubleDisposed).toBeCalledTimes(1)
998998
})
999999

1000-
it("Legacy context support", () => {
1001-
const contextKey = "key"
1002-
const contextValue = "value"
1003-
1004-
function ContextConsumer(_, context) {
1005-
expect(context[contextKey]).toBe(contextValue)
1006-
return null
1007-
}
1008-
1009-
ContextConsumer.contextTypes = {
1010-
[contextKey]: () => null
1011-
}
1012-
1013-
const ObserverContextConsumer = observer(ContextConsumer)
1014-
1015-
class ContextProvider extends React.Component {
1016-
getChildContext() {
1017-
return { [contextKey]: contextValue }
1018-
}
1019-
1020-
render() {
1021-
return <ObserverContextConsumer />
1022-
}
1023-
}
1024-
1025-
;(ContextProvider as any).childContextTypes = {
1026-
[contextKey]: () => null
1027-
}
1028-
1029-
render(<ContextProvider />)
1030-
})
1031-
10321000
it("Throw when trying to set contextType on observer", () => {
10331001
const NamedObserver = observer(function TestCmp() {
10341002
return null

0 commit comments

Comments
 (0)