@@ -14,24 +14,8 @@ describe('React', () => {
1414 afterEach ( ( ) => rtl . cleanup ( ) )
1515
1616 const createChild = ( storeKey = 'store' ) => {
17- /*
1817 class Child extends Component {
1918 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];
3519 return (
3620 < ReactReduxContext . Consumer >
3721 { ( { store } ) => {
@@ -49,20 +33,6 @@ describe('React', () => {
4933 } }
5034 </ ReactReduxContext . Consumer >
5135 )
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- */
6636 }
6737 }
6838
@@ -103,7 +73,7 @@ describe('React', () => {
10373 Provider . propTypes = propTypes
10474 } )
10575
106- it ( 'should add the store state to context' , ( ) => {
76+ it ( 'should add the store to context' , ( ) => {
10777 const store = createStore ( createExampleTextReducer ( ) )
10878
10979 const spy = jest . spyOn ( console , 'error' ) . mockImplementation ( ( ) => { } )
@@ -145,12 +115,6 @@ describe('React', () => {
145115 const tester = rtl . render ( < ProviderContainer /> )
146116 expect ( tester . getByTestId ( 'store' ) ) . toHaveTextContent ( 'store - 11' )
147117
148- /*
149- rtl.act(() => {
150- store1.dispatch({ type: 'hi' })
151- })
152- expect(tester.getByTestId('store')).toHaveTextContent('store - 12')
153- */
154118 rtl . act ( ( ) => {
155119 externalSetState ( { store : store2 } )
156120 } )
0 commit comments