@@ -14,24 +14,8 @@ describe('React', () => {
14
14
afterEach ( ( ) => rtl . cleanup ( ) )
15
15
16
16
const createChild = ( storeKey = 'store' ) => {
17
- /*
18
17
class Child extends Component {
19
18
render ( ) {
20
- return (
21
- <ReactReduxContext.Consumer>
22
- {({ storeState }) => {
23
- return (
24
- <div data-testid="store">{`${storeKey} - ${storeState}`}</div>
25
- )
26
- }}
27
- </ReactReduxContext.Consumer>
28
- )
29
- }
30
- }
31
- */
32
- class Child extends Component {
33
- render ( ) {
34
- //const store = this.context[storeKey];
35
19
return (
36
20
< ReactReduxContext . Consumer >
37
21
{ ( { store } ) => {
@@ -49,20 +33,6 @@ describe('React', () => {
49
33
} }
50
34
</ ReactReduxContext . Consumer >
51
35
)
52
-
53
- /*
54
- let text = '';
55
-
56
- if(store) {
57
- text = store.getState().toString()
58
- }
59
-
60
- return (
61
- <div data-testid="store">
62
- {storeKey} - {text}
63
- </div>
64
- )
65
- */
66
36
}
67
37
}
68
38
@@ -103,7 +73,7 @@ describe('React', () => {
103
73
Provider . propTypes = propTypes
104
74
} )
105
75
106
- it ( 'should add the store state to context' , ( ) => {
76
+ it ( 'should add the store to context' , ( ) => {
107
77
const store = createStore ( createExampleTextReducer ( ) )
108
78
109
79
const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
@@ -145,12 +115,6 @@ describe('React', () => {
145
115
const tester = rtl . render ( < ProviderContainer /> )
146
116
expect ( tester . getByTestId ( 'store' ) ) . toHaveTextContent ( 'store - 11' )
147
117
148
- /*
149
- rtl.act(() => {
150
- store1.dispatch({ type: 'hi' })
151
- })
152
- expect(tester.getByTestId('store')).toHaveTextContent('store - 12')
153
- */
154
118
rtl . act ( ( ) => {
155
119
externalSetState ( { store : store2 } )
156
120
} )
0 commit comments