diff --git a/spec/pivotal-ui-react/radio/radio_spec.js b/spec/pivotal-ui-react/radio/radio_spec.js index bc801cfd5..304a80be3 100644 --- a/spec/pivotal-ui-react/radio/radio_spec.js +++ b/spec/pivotal-ui-react/radio/radio_spec.js @@ -55,4 +55,18 @@ describe('Radio', function() { }); }); }); + + describe('when className and style are passed', () => { + beforeEach(() =>{ + React.render( + + One!!! + , root); + }); + it('passes through className and style', () => { + expect('#root .radio').toHaveClass('radio-class'); + expect('#root .radio').toHaveCss({opacity: '1'}); + }); + }); + }); diff --git a/src/pivotal-ui-react/radio/radio.js b/src/pivotal-ui-react/radio/radio.js index e79d23f34..d77837192 100644 --- a/src/pivotal-ui-react/radio/radio.js +++ b/src/pivotal-ui-react/radio/radio.js @@ -1,4 +1,5 @@ var React = require('react'); +import {mergeProps} from '../../../src/pivotal-ui-react/helpers/helpers'; /** * @component Radio @@ -34,9 +35,11 @@ var Radio = React.createClass({ }, render: function() { + const {className, style, ...others} = this.props; + const props = mergeProps({className: className, style: style}, {className: 'radio'}); return ( -
- +
+
); }