@@ -115,6 +115,68 @@ describe('Nav', function () {
115115 assert . ok ( items [ 0 ] . props . navItem ) ;
116116 } ) ;
117117
118+ it ( 'Should apply className only to the wrapper nav element' , function ( ) {
119+ const instance = ReactTestUtils . renderIntoDocument (
120+ < Nav bsStyle = "tabs" activeKey = { 1 } className = "nav-specific" >
121+ < NavItem key = { 1 } > Tab 1 content</ NavItem >
122+ < NavItem key = { 2 } > Tab 2 content</ NavItem >
123+ </ Nav >
124+ ) ;
125+
126+ let ulNode = React . findDOMNode ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'ul' ) ) ;
127+ assert . notInclude ( ulNode . className , 'nav-specific' ) ;
128+
129+ let navNode = React . findDOMNode ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'nav' ) ) ;
130+ assert . include ( navNode . className , 'nav-specific' ) ;
131+ } ) ;
132+
133+ it ( 'Should apply ulClassName to the inner ul element' , function ( ) {
134+ const instance = ReactTestUtils . renderIntoDocument (
135+ < Nav bsStyle = "tabs" activeKey = { 1 } className = "nav-specific" ulClassName = "ul-specific" >
136+ < NavItem key = { 1 } > Tab 1 content</ NavItem >
137+ < NavItem key = { 2 } > Tab 2 content</ NavItem >
138+ </ Nav >
139+ ) ;
140+
141+ let ulNode = React . findDOMNode ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'ul' ) ) ;
142+ assert . include ( ulNode . className , 'ul-specific' ) ;
143+ assert . notInclude ( ulNode . className , 'nav-specific' ) ;
144+
145+ let navNode = React . findDOMNode ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'nav' ) ) ;
146+ assert . notInclude ( navNode . className , 'ul-specific' ) ;
147+ assert . include ( navNode . className , 'nav-specific' ) ;
148+ } ) ;
149+
150+ it ( 'Should apply id to the wrapper nav element' , function ( ) {
151+ const instance = ReactTestUtils . renderIntoDocument (
152+ < Nav bsStyle = "tabs" activeKey = { 1 } id = "nav-id" >
153+ < NavItem key = { 1 } > Tab 1 content</ NavItem >
154+ < NavItem key = { 2 } > Tab 2 content</ NavItem >
155+ </ Nav >
156+ ) ;
157+
158+ let navNode = React . findDOMNode ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'nav' ) ) ;
159+ assert . equal ( navNode . id , 'nav-id' ) ;
160+
161+ let ulNode = React . findDOMNode ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'ul' ) ) ;
162+ assert . notEqual ( ulNode . id , 'nav-id' ) ;
163+ } ) ;
164+
165+ it ( 'Should apply ulId to the inner ul element' , function ( ) {
166+ const instance = ReactTestUtils . renderIntoDocument (
167+ < Nav bsStyle = "tabs" activeKey = { 1 } id = "nav-id" ulId = "ul-id" >
168+ < NavItem key = { 1 } > Tab 1 content</ NavItem >
169+ < NavItem key = { 2 } > Tab 2 content</ NavItem >
170+ </ Nav >
171+ ) ;
172+
173+ let ulNode = React . findDOMNode ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'ul' ) ) ;
174+ assert . equal ( ulNode . id , 'ul-id' ) ;
175+
176+ let navNode = React . findDOMNode ( ReactTestUtils . findRenderedDOMComponentWithTag ( instance , 'nav' ) ) ;
177+ assert . equal ( navNode . id , 'nav-id' ) ;
178+ } ) ;
179+
118180
119181 describe ( 'Web Accessibility' , function ( ) {
120182
0 commit comments