Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(react-chart): fix style applying in legend label in material-ui #1374

Merged
merged 5 commits into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const styles = () => ({
class LabelBase extends React.PureComponent {
render() {
const {
text, style, classes, className, ...restProps
text, classes, className, ...restProps
} = this.props;
return (
<ListItemText
Expand All @@ -33,14 +33,12 @@ LabelBase.propTypes = {
PropTypes.string,
PropTypes.number,
]).isRequired,
style: PropTypes.object,
classes: PropTypes.object.isRequired,
className: PropTypes.string,
};

LabelBase.defaultProps = {
className: undefined,
style: null,
};

export const Label = withStyles(styles, { name: 'LegendLabel' })(LabelBase);
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,12 @@ describe('Label', () => {
expect(customProperty)
.toBeTruthy();
});

it('should pass the style to the element', () => {
const tree = shallow(<Label {...defaultProps} style />);
const { style } = tree.find(ListItemText).props();

expect(style)
.toBeTruthy();
});
});