@@ -9,9 +9,9 @@ describe('ImageCard', () => {
99            < ImageCard  src = "https://i.imgur.com/pEI5qWM.jpeg"  alt = "Cat 🐱"  /> 
1010        ) 
1111        const  image  =  await  screen . findByRole ( 'img' ) 
12-         expect ( image ) . toBeVisible ( ) 
1312        expect ( image ) . toHaveAttribute ( 'src' ,  'https://i.imgur.com/pEI5qWM.jpeg' ) 
1413        expect ( image ) . toHaveAttribute ( 'alt' ,  'Cat 🐱' ) 
14+         expect ( image ) . toBeVisible ( ) 
1515    } ) 
1616
1717    it ( 'should apply custom width and height when provided' ,  ( )  =>  { 
@@ -30,6 +30,7 @@ describe('ImageCard', () => {
3030        const  image  =  screen . getByRole ( 'img' ) 
3131        expect ( image ) . toHaveAttribute ( 'width' ,  testWidth . toString ( ) ) 
3232        expect ( image ) . toHaveAttribute ( 'height' ,  testHeight . toString ( ) ) 
33+         expect ( image ) . toBeVisible ( ) 
3334    } ) 
3435
3536    it ( 'should handle string-based width and height' ,  ( )  =>  { 
@@ -48,6 +49,7 @@ describe('ImageCard', () => {
4849        const  image  =  screen . getByRole ( 'img' ) 
4950        expect ( image ) . toHaveAttribute ( 'width' ,  testWidth ) 
5051        expect ( image ) . toHaveAttribute ( 'height' ,  testHeight ) 
52+         expect ( image ) . toBeVisible ( ) 
5153    } ) 
5254
5355    it ( 'should render even when width and height are not provided' ,  ( )  =>  { 
@@ -56,5 +58,6 @@ describe('ImageCard', () => {
5658        const  image  =  screen . getByRole ( 'img' ) 
5759        expect ( image ) . not . toHaveAttribute ( 'width' ) 
5860        expect ( image ) . not . toHaveAttribute ( 'height' ) 
61+         expect ( image ) . toBeVisible ( ) 
5962    } ) 
6063} ) 
0 commit comments