@@ -426,10 +426,12 @@ describe('React', () => {
426426
427427 let invocationCount = 0
428428
429- @connect ( ( ) => {
429+ /*eslint-disable no-unused-vars */
430+ @connect ( ( arg1 ) => {
430431 invocationCount ++
431432 return { }
432433 } )
434+ /*eslint-enable no-unused-vars */
433435 class WithoutProps extends Component {
434436 render ( ) {
435437 return < Passthrough { ...this . props } />
@@ -467,6 +469,53 @@ describe('React', () => {
467469 expect ( invocationCount ) . toEqual ( 2 )
468470 } )
469471
472+ it ( 'should invoke mapState every time props are changed if it has zero arguments' , ( ) => {
473+ const store = createStore ( stringBuilder )
474+
475+ let invocationCount = 0
476+
477+ @connect ( ( ) => {
478+ invocationCount ++
479+ return { }
480+ } )
481+
482+ class WithoutProps extends Component {
483+ render ( ) {
484+ return < Passthrough { ...this . props } />
485+ }
486+ }
487+
488+ class OuterComponent extends Component {
489+ constructor ( ) {
490+ super ( )
491+ this . state = { foo : 'FOO' }
492+ }
493+
494+ setFoo ( foo ) {
495+ this . setState ( { foo } )
496+ }
497+
498+ render ( ) {
499+ return (
500+ < div >
501+ < WithoutProps { ...this . state } />
502+ </ div >
503+ )
504+ }
505+ }
506+
507+ let outerComponent
508+ TestUtils . renderIntoDocument (
509+ < ProviderMock store = { store } >
510+ < OuterComponent ref = { c => outerComponent = c } />
511+ </ ProviderMock >
512+ )
513+ outerComponent . setFoo ( 'BAR' )
514+ outerComponent . setFoo ( 'DID' )
515+
516+ expect ( invocationCount ) . toEqual ( 4 )
517+ } )
518+
470519 it ( 'should invoke mapState every time props are changed if it has a second argument' , ( ) => {
471520 const store = createStore ( stringBuilder )
472521
@@ -524,10 +573,12 @@ describe('React', () => {
524573
525574 let invocationCount = 0
526575
527- @connect ( null , ( ) => {
576+ /*eslint-disable no-unused-vars */
577+ @connect ( null , ( arg1 ) => {
528578 invocationCount ++
529579 return { }
530580 } )
581+ /*eslint-enable no-unused-vars */
531582 class WithoutProps extends Component {
532583 render ( ) {
533584 return < Passthrough { ...this . props } />
@@ -566,6 +617,54 @@ describe('React', () => {
566617 expect ( invocationCount ) . toEqual ( 1 )
567618 } )
568619
620+ it ( 'should invoke mapDispatch every time props are changed if it has zero arguments' , ( ) => {
621+ const store = createStore ( stringBuilder )
622+
623+ let invocationCount = 0
624+
625+ @connect ( null , ( ) => {
626+ invocationCount ++
627+ return { }
628+ } )
629+
630+ class WithoutProps extends Component {
631+ render ( ) {
632+ return < Passthrough { ...this . props } />
633+ }
634+ }
635+
636+ class OuterComponent extends Component {
637+ constructor ( ) {
638+ super ( )
639+ this . state = { foo : 'FOO' }
640+ }
641+
642+ setFoo ( foo ) {
643+ this . setState ( { foo } )
644+ }
645+
646+ render ( ) {
647+ return (
648+ < div >
649+ < WithoutProps { ...this . state } />
650+ </ div >
651+ )
652+ }
653+ }
654+
655+ let outerComponent
656+ TestUtils . renderIntoDocument (
657+ < ProviderMock store = { store } >
658+ < OuterComponent ref = { c => outerComponent = c } />
659+ </ ProviderMock >
660+ )
661+
662+ outerComponent . setFoo ( 'BAR' )
663+ outerComponent . setFoo ( 'DID' )
664+
665+ expect ( invocationCount ) . toEqual ( 3 )
666+ } )
667+
569668 it ( 'should invoke mapDispatch every time props are changed if it has a second argument' , ( ) => {
570669 const store = createStore ( stringBuilder )
571670
0 commit comments