These are chat archives for airbnb/enzyme

Jun 2017
Vamsi Ampolu
Jun 19 2017 07:05

I have recently introduced styled-components into my project and I have been facing a bit of trouble understanding how to test them, my component looks like:

export const StyledCheckboxGroup = styled(CheckboxGroup)`
> .ant-checkbox-group-item {
display: ${props => (props.inline ? 'inline-block' : 'block')};

I want to test that the styled component renders with the styling correctly, is there a way to render this component which uses this and see if it works correctly, it looks like the css className changes every time and I might have false positives if I try and use ant-checkbox-group-item by itself.

Is there a good solution for testing styled-components with or without enzyme?