@@ -38,6 +38,7 @@ const htmlForValid = [
3838] ;
3939const nestingValid = [
4040 { code : '<label>A label<input /></label>' } ,
41+ { code : '<label>A label<textarea /></label>' } ,
4142 { code : '<label><img alt="A label" /><input /></label>' } ,
4243 { code : '<label><img aria-label="A label" /><input /></label>' } ,
4344 { code : '<label><span>A label<input /></span></label>' } ,
@@ -56,6 +57,7 @@ const bothValid = [
5657 { code : '<label htmlFor="js_id"><span><span><span>A label<input /></span></span></span></label>' , options : [ { depth : 4 } ] } ,
5758 { code : '<label htmlFor="js_id" aria-label="A label"><input /></label>' } ,
5859 { code : '<label htmlFor="js_id" aria-labelledby="A label"><input /></label>' } ,
60+ { code : '<label htmlFor="js_id" aria-labelledby="A label"><textarea /></label>' } ,
5961 // Custom label component.
6062 { code : '<CustomLabel htmlFor="js_id" aria-label="A label"><input /></CustomLabel>' , options : [ { labelComponents : [ 'CustomLabel' ] } ] } ,
6163 { code : '<CustomLabel htmlFor="js_id" label="A label"><input /></CustomLabel>' , options : [ { labelAttributes : [ 'label' ] , labelComponents : [ 'CustomLabel' ] } ] } ,
@@ -80,6 +82,7 @@ const htmlForInvalid = [
8082] ;
8183const nestingInvalid = [
8284 { code : '<label>A label<input /></label>' , errors : [ expectedError ] } ,
85+ { code : '<label>A label<textarea /></label>' , errors : [ expectedError ] } ,
8386 { code : '<label><img alt="A label" /><input /></label>' , errors : [ expectedError ] } ,
8487 { code : '<label><img aria-label="A label" /><input /></label>' , errors : [ expectedError ] } ,
8588 { code : '<label><span>A label<input /></span></label>' , errors : [ expectedError ] } ,
@@ -97,6 +100,7 @@ const nestingInvalid = [
97100const neverValid = [
98101 { code : '<label htmlFor="js_id" />' , errors : [ expectedError ] } ,
99102 { code : '<label htmlFor="js_id"><input /></label>' , errors : [ expectedError ] } ,
103+ { code : '<label htmlFor="js_id"><textarea /></label>' , errors : [ expectedError ] } ,
100104 { code : '<label></label>' , errors : [ expectedError ] } ,
101105 { code : '<label>A label</label>' , errors : [ expectedError ] } ,
102106 { code : '<div><label /><input /></div>' , errors : [ expectedError ] } ,
0 commit comments