File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed
Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ import { themr, themeable } from '../../src/index'
99describe ( 'Themr decorator function' , ( ) => {
1010 class Passthrough extends Component {
1111 render ( ) {
12- return < div { ...this . props } />
12+ const { theme, ...props } = this . props //eslint-disable-line no-unused-vars
13+ return < div { ...props } />
1314 }
1415 }
1516
@@ -495,6 +496,25 @@ describe('Themr decorator function', () => {
495496 expect ( spy . callCount === 4 ) . toBe ( true )
496497 }
497498 )
499+
500+ it ( 'should not pass internal themr props to WrappedComponent' , ( ) => {
501+ @themr ( 'Container' )
502+ class Container extends Component {
503+ render ( ) {
504+ return < Passthrough { ...this . props } />
505+ }
506+ }
507+
508+ const tree = TestUtils . renderIntoDocument (
509+ < Container />
510+ )
511+
512+ const stub = TestUtils . findRenderedComponentWithType ( tree , Passthrough )
513+ // expect(stub.props.theme).toEqual(containerTheme)
514+ expect ( stub . props . themeNamespace ) . toNotExist ( )
515+ expect ( stub . props . composeTheme ) . toNotExist ( )
516+ expect ( stub . props . theme ) . toExist ( )
517+ } )
498518} )
499519
500520describe ( 'themeable function' , ( ) => {
You can’t perform that action at this time.
0 commit comments