File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -105,12 +105,13 @@ const TabbedArea = React.createClass({
105105 } ,
106106
107107 renderTab ( child ) {
108- let key = child . props . eventKey ;
108+ let { eventKey , className , tab } = child . props ;
109109 return (
110110 < NavItem
111- ref = { 'tab' + key }
112- eventKey = { key } >
113- { child . props . tab }
111+ ref = { 'tab' + eventKey }
112+ eventKey = { eventKey }
113+ className = { className } >
114+ { tab }
114115 </ NavItem >
115116 ) ;
116117 } ,
Original file line number Diff line number Diff line change @@ -182,4 +182,20 @@ describe('TabbedArea', function () {
182182
183183 assert . ok ( ReactTestUtils . findRenderedDOMComponentWithClass ( instance , 'nav-pills' ) ) ;
184184 } ) ;
185+
186+ it ( 'Should pass className to rendered Tab NavItem' , function ( ) {
187+ let instance = ReactTestUtils . renderIntoDocument (
188+ < TabbedArea activeKey = { 3 } >
189+ < TabPane tab = "Tab 1" eventKey = { 1 } > Tab 1 content</ TabPane >
190+ < TabPane className = "pull-right" tab = "Tab 2" eventKey = { 3 } > Tab 3 content</ TabPane >
191+ </ TabbedArea >
192+ ) ;
193+
194+ let tabPane = ReactTestUtils . scryRenderedComponentsWithType ( instance , TabPane ) ;
195+
196+ assert . equal ( tabPane . length , 2 ) ;
197+ assert . equal ( tabPane [ 1 ] . getDOMNode ( ) . getAttribute ( 'class' ) . match ( / p u l l - r i g h t / ) [ 0 ] , 'pull-right' ) ;
198+ } ) ;
199+
200+
185201} ) ;
You can’t perform that action at this time.
0 commit comments