Closed penx closed 6 years ago
FWIW I'm not sure the compose approach to extending styles is a good one (keen to hear opinion on this) and would prefer passing specific props down for styles that can be overridden, but I think this is a valid bug non the less.
Here's a failing test that can be added to src/__tests__/index.js
, I can't commit it as the commit hook prevents commits with failing tests 😀
test('can render nested components', () => {
const InnerOne = glamorous.div({
color: '#F00',
})
const InnerTwo = props => <InnerOne {...props} />
const Example = glamorous(InnerTwo)(({color}) => ({
color: color ? color : undefined,
}))
expect(mount(<Example />)).toMatchSnapshot()
})
FYI @penx, you should be able to bypass the local commit hooks by appending --no-verify
when committing if you wanted to get something shared easier 👍
This project is now in an unmaintained status. Please see the README for more information.
glamorous
version: 4.12.1glamor
version: 2.20.40react
version: 16.2.0Relevant code:
Component
Example.js
Test
Example.test.js
What you did:
What happened:
The component will render fine in storybook etc. but when we run the test we get an error:
We've also tried with another test framework and get the same error.
Reproduction:
Shown in PR with breaking unit test - https://github.com/paypal/glamorous/pull/397