Skip to content

Commit 26aac97

Browse files
committed
tests
1 parent d82739e commit 26aac97

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

test/components/themr.spec.js

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ import { themr, themeable } from '../../src/index'
99
describe('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

500520
describe('themeable function', () => {

0 commit comments

Comments
 (0)