@@ -152,16 +152,18 @@ describe('ProgressBar', function () {
152
152
< ProgressBar min = { 1 } max = { 11 } now = { 6 } striped />
153
153
) ;
154
154
155
- assert . ok ( React . findDOMNode ( instance ) . className . match ( / \b p r o g r e s s - s t r i p e d \b / ) ) ;
155
+ assert . ok ( React . findDOMNode ( instance ) . firstChild . className . match ( / \b p r o g r e s s - b a r - s t r i p e d \b / ) ) ;
156
156
} ) ;
157
157
158
158
it ( 'Should show animated striped bar' , function ( ) {
159
159
let instance = ReactTestUtils . renderIntoDocument (
160
160
< ProgressBar min = { 1 } max = { 11 } now = { 6 } active />
161
161
) ;
162
162
163
- assert . ok ( React . findDOMNode ( instance ) . className . match ( / \b p r o g r e s s - s t r i p e d \b / ) ) ;
164
- assert . ok ( React . findDOMNode ( instance ) . className . match ( / \b a c t i v e \b / ) ) ;
163
+ const barClassName = React . findDOMNode ( instance ) . firstChild . className ;
164
+
165
+ assert . ok ( barClassName . match ( / \b p r o g r e s s - b a r - s t r i p e d \b / ) ) ;
166
+ assert . ok ( barClassName . match ( / \b a c t i v e \b / ) ) ;
165
167
} ) ;
166
168
167
169
it ( 'Should show stacked bars' , function ( ) {
@@ -182,6 +184,28 @@ describe('ProgressBar', function () {
182
184
assert . equal ( bar2 . style . width , '30%' ) ;
183
185
} ) ;
184
186
187
+ it ( 'Should render active and striped children in stacked bar too' , function ( ) {
188
+ let instance = ReactTestUtils . renderIntoDocument (
189
+ < ProgressBar >
190
+ < ProgressBar active key = { 1 } now = { 50 } />
191
+ < ProgressBar striped key = { 2 } now = { 30 } />
192
+ </ ProgressBar >
193
+ ) ;
194
+ let wrapper = React . findDOMNode ( instance ) ;
195
+ let bar1 = wrapper . firstChild ;
196
+ let bar2 = wrapper . lastChild ;
197
+
198
+ assert . ok ( wrapper . className . match ( / \b p r o g r e s s \b / ) ) ;
199
+
200
+ assert . ok ( bar1 . className . match ( / \b p r o g r e s s - b a r \b / ) ) ;
201
+ assert . ok ( bar1 . className . match ( / \b a c t i v e \b / ) ) ;
202
+ assert . ok ( bar1 . className . match ( / \b p r o g r e s s - b a r - s t r i p e d \b / ) ) ;
203
+
204
+ assert . ok ( bar2 . className . match ( / \b p r o g r e s s - b a r \b / ) ) ;
205
+ assert . ok ( bar2 . className . match ( / \b p r o g r e s s - b a r - s t r i p e d \b / ) ) ;
206
+ assert . notOk ( bar2 . className . match ( / \b a c t i v e \b / ) ) ;
207
+ } ) ;
208
+
185
209
it ( 'allows only ProgressBar in children' , function ( ) {
186
210
ReactTestUtils . renderIntoDocument (
187
211
< ProgressBar >
0 commit comments