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'
9
9
describe ( 'Themr decorator function' , ( ) => {
10
10
class Passthrough extends Component {
11
11
render ( ) {
12
- return < div { ...this . props } />
12
+ const { theme, ...props } = this . props //eslint-disable-line no-unused-vars
13
+ return < div { ...props } />
13
14
}
14
15
}
15
16
@@ -495,6 +496,25 @@ describe('Themr decorator function', () => {
495
496
expect ( spy . callCount === 4 ) . toBe ( true )
496
497
}
497
498
)
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
+ } )
498
518
} )
499
519
500
520
describe ( 'themeable function' , ( ) => {
You can’t perform that action at this time.
0 commit comments