From 9f736c9058933694d0434d6a0b41a00e14e62c2b Mon Sep 17 00:00:00 2001 From: Kenny Wang Date: Thu, 16 Jul 2015 17:55:17 -0700 Subject: [PATCH] feat(radio): Classname and style passes through to radio div [Finishes #98913402] --- spec/pivotal-ui-react/radio/radio_spec.js | 14 ++++++++++++++ src/pivotal-ui-react/radio/radio.js | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) 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 ( -
- +
+
); }