@@ -158,8 +158,7 @@ describe("hasLabelledChildImage", () => {
158158} ) ;
159159
160160describe ( "hasLabelledChildImage - missing coverage" , ( ) => {
161- it ( "covers line 34 - handles non-JSXElement children" , ( ) => {
162- // This test covers the case where children exist but are not JSXElement types
161+ it ( "handles non-JSXElement children" , ( ) => {
163162 const mockTextChild : TSESTree . JSXText = {
164163 type : AST_NODE_TYPES . JSXText ,
165164 value : "Some text content" ,
@@ -188,16 +187,14 @@ describe("hasLabelledChildImage - missing coverage", () => {
188187 ...createMockLocRange ( )
189188 } ,
190189 closingElement : null ,
191- children : [ mockTextChild , mockExpressionChild ] , // Non-JSXElement children
190+ children : [ mockTextChild , mockExpressionChild ] ,
192191 ...createMockLocRange ( )
193192 } ;
194193
195- // This should execute line 34 and return false since no JSXElement children are found
196194 expect ( hasLabelledChildImage ( node ) ) . toBe ( false ) ;
197195 } ) ;
198196
199- it ( "covers line 34 - JSXElement child with non-image component name" , ( ) => {
200- // This covers the case where we have JSXElement children but they're not image components
197+ it ( "JSXElement child with non-image component name" , ( ) => {
201198 const mockDivChild : TSESTree . JSXElement = {
202199 type : AST_NODE_TYPES . JSXElement ,
203200 openingElement : {
@@ -233,14 +230,12 @@ describe("hasLabelledChildImage - missing coverage", () => {
233230 ...createMockLocRange ( )
234231 } ;
235232
236- // This should execute line 34 and return false since child is not an image component
237233 expect ( hasLabelledChildImage ( node ) ) . toBe ( false ) ;
238234 } ) ;
239235} ) ;
240236
241237describe ( "isImageHidden - missing coverage for aria-label handling" , ( ) => {
242- it ( "covers lines 70-72 - returns false when aria-label has non-empty value" , ( ) => {
243- // This covers the case where aria-label is present and has a value (lines 70-72)
238+ it ( "returns false when aria-label has non-empty value" , ( ) => {
244239 const attributes : TSESTree . JSXOpeningElement [ "attributes" ] = [
245240 {
246241 type : AST_NODE_TYPES . JSXAttribute ,
@@ -255,12 +250,10 @@ describe("isImageHidden - missing coverage for aria-label handling", () => {
255250 }
256251 ] ;
257252
258- // Should return false because aria-label has a value, meaning image is not hidden
259253 expect ( isImageHidden ( attributes ) ) . toBe ( false ) ;
260254 } ) ;
261255
262- it ( "covers lines 70-72 - returns false when aria-labelledby has non-empty value" , ( ) => {
263- // This covers the case where aria-labelledby is present and has a value
256+ it ( "returns false when aria-labelledby has non-empty value" , ( ) => {
264257 const attributes : TSESTree . JSXOpeningElement [ "attributes" ] = [
265258 {
266259 type : AST_NODE_TYPES . JSXAttribute ,
@@ -275,12 +268,10 @@ describe("isImageHidden - missing coverage for aria-label handling", () => {
275268 }
276269 ] ;
277270
278- // Should return false because aria-labelledby has a value, meaning image is not hidden
279271 expect ( isImageHidden ( attributes ) ) . toBe ( false ) ;
280272 } ) ;
281273
282274 it ( "handles case with both aria-label and aria-labelledby present" , ( ) => {
283- // Additional test to ensure proper handling when both attributes are present
284275 const attributes : TSESTree . JSXOpeningElement [ "attributes" ] = [
285276 {
286277 type : AST_NODE_TYPES . JSXAttribute ,
@@ -306,7 +297,6 @@ describe("isImageHidden - missing coverage for aria-label handling", () => {
306297 }
307298 ] ;
308299
309- // Should return false because aria-label has a value
310300 expect ( isImageHidden ( attributes ) ) . toBe ( false ) ;
311301 } ) ;
312302} ) ;
0 commit comments