@@ -291,7 +291,7 @@ describe('labels', () => {
291291 } ) ;
292292 } ) ;
293293
294- it ( 'does not warn when the label text is inside a child component' , ( done ) => {
294+ it ( 'does not warn when the label text is inside a child component' , ( ) => {
295295 var Foo = React . createClass ( {
296296 render : function ( ) {
297297 return (
@@ -303,11 +303,39 @@ describe('labels', () => {
303303 } ) ;
304304
305305 doNotExpectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
306- React . render ( < div role = "button" > < span > < Foo /> </ span > </ div > , fixture , done ) ;
306+ React . render ( < div role = "button" > < span > < Foo /> </ span > </ div > , fixture ) ;
307307 } ) ;
308308 } ) ;
309309
310- it ( 'does not warn when the label is an image with alt text inside a child component' , ( done ) => {
310+ it ( 'does not warn when the label is an image with alt text' , ( ) => {
311+ var Foo = React . createClass ( {
312+ render : function ( ) {
313+ return (
314+ < img alt = "foo" />
315+ ) ;
316+ }
317+ } ) ;
318+
319+ doNotExpectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
320+ React . render ( < div role = "button" > < Foo /> </ div > , fixture ) ;
321+ } ) ;
322+ } ) ;
323+
324+ it ( 'warns when the label is an image without alt text' , ( ) => {
325+ var Foo = React . createClass ( {
326+ render : function ( ) {
327+ return (
328+ < img alt = "" />
329+ ) ;
330+ }
331+ } ) ;
332+
333+ expectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
334+ React . render ( < div role = "button" > < Foo /> </ div > , fixture ) ;
335+ } ) ;
336+ } ) ;
337+
338+ it ( 'does not warn when the label is an image with alt text nested inside a child component' , ( ) => {
311339 var Foo = React . createClass ( {
312340 render : function ( ) {
313341 return (
@@ -319,11 +347,11 @@ describe('labels', () => {
319347 } ) ;
320348
321349 doNotExpectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
322- React . render ( < div role = "button" > < span > < Foo /> </ span > </ div > , fixture , done ) ;
350+ React . render ( < div role = "button" > < span > < Foo /> </ span > </ div > , fixture ) ;
323351 } ) ;
324352 } ) ;
325353
326- it ( 'warns when a child is a component with image content without alt ' , ( done ) => {
354+ it ( 'warns when an image without alt text is nested inside a child component ' , ( ) => {
327355 var Foo = React . createClass ( {
328356 render : function ( ) {
329357 return (
@@ -335,11 +363,11 @@ describe('labels', () => {
335363 } ) ;
336364
337365 expectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
338- React . render ( < div role = "button" > < span > < Foo /> </ span > </ div > , fixture , done ) ;
366+ React . render ( < div role = "button" > < span > < Foo /> </ span > </ div > , fixture ) ;
339367 } ) ;
340368 } ) ;
341369
342- it ( 'does not warn when there is an image without alt text with a sibling text node' , ( done ) => {
370+ it ( 'does not warn when there is an image without alt text with a sibling text node' , ( ) => {
343371 var Foo = React . createClass ( {
344372 render : function ( ) {
345373 return (
@@ -351,11 +379,11 @@ describe('labels', () => {
351379 } ) ;
352380
353381 doNotExpectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
354- React . render ( < div role = "button" > < span > < Foo /> </ span > </ div > , fixture , done ) ;
382+ React . render ( < div role = "button" > < span > < Foo /> </ span > </ div > , fixture ) ;
355383 } ) ;
356384 } ) ;
357385
358- it ( 'warns when a child is a component without text content' , ( done ) => {
386+ it ( 'warns when a child is a component without text content' , ( ) => {
359387 var Bar = React . createClass ( {
360388 render : ( ) => {
361389 return (
@@ -365,11 +393,11 @@ describe('labels', () => {
365393 } ) ;
366394
367395 expectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
368- React . render ( < div role = "button" > < Bar /> </ div > , fixture , done ) ;
396+ React . render ( < div role = "button" > < Bar /> </ div > , fixture ) ;
369397 } ) ;
370398 } ) ;
371399
372- it ( 'does not warn as long as one child component has label text' , ( done ) => {
400+ it ( 'does not warn as long as one child component has label text' , ( ) => {
373401 var Bar = React . createClass ( {
374402 render : ( ) => {
375403 return (
@@ -389,11 +417,11 @@ describe('labels', () => {
389417 } ) ;
390418
391419 doNotExpectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
392- React . render ( < div role = "button" > < Bar /> < Foo /> </ div > , fixture , done ) ;
420+ React . render ( < div role = "button" > < Bar /> < Foo /> </ div > , fixture ) ;
393421 } ) ;
394422 } ) ;
395423
396- it ( 'warns if no child components have label text' , ( done ) => {
424+ it ( 'warns if no child components have label text' , ( ) => {
397425 var Bar = React . createClass ( {
398426 render : ( ) => {
399427 return (
@@ -411,12 +439,12 @@ describe('labels', () => {
411439 } ) ;
412440
413441 expectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
414- React . render ( < div role = "button" > < Bar /> < Foo /> </ div > , fixture , done ) ;
442+ React . render ( < div role = "button" > < Bar /> < div /> < Foo /> </ div > , fixture ) ;
415443 } ) ;
416444 } ) ;
417445
418446
419- it ( 'does not error when the component has a componentDidMount callback' , ( done ) => {
447+ it ( 'does not error when the component has a componentDidMount callback' , ( ) => {
420448 var Bar = React . createClass ( {
421449 _privateProp : 'bar' ,
422450
@@ -431,7 +459,7 @@ describe('labels', () => {
431459 } ) ;
432460
433461 expectWarning ( assertions . render . NO_LABEL . msg , ( ) => {
434- React . render ( < div role = "button" > < Bar /> </ div > , fixture , done ) ;
462+ React . render ( < div role = "button" > < Bar /> </ div > , fixture ) ;
435463 } ) ;
436464 } ) ;
437465
0 commit comments