@@ -31,39 +31,40 @@ function generateTestCases(labelComponent: string, componentName: string) {
3131function generateTestCasesLabel ( labelComponent : string , componentName : string ) {
3232 return {
3333 valid : [
34- `<><${ labelComponent } htmlFor="some-id">Some Label</${ labelComponent } ><${ componentName } id="some-id"/></>` ,
35- `<><${ labelComponent } id="test-span">Some Label</${ labelComponent } ><${ componentName } id="some-id" aria-labelledby="test-span"/></>` ,
36- `<${ labelComponent } >test</${ labelComponent } >` ,
37- `<${ labelComponent } >test<${ componentName } /></${ labelComponent } >` ,
38- `<${ labelComponent } >test<SomeNesting><${ componentName } /></SomeNesting></${ labelComponent } >` ,
39- `<Field label="this is my label"><${ componentName } /></Field>` ,
40- `<${ componentName } aria-label="this is my component" />`
34+ // `<><${labelComponent} htmlFor="some-id">Some Label</${labelComponent}><${componentName} id="some-id"/></>`,
35+ // `<><${labelComponent} id="test-span">Some Label</${labelComponent}><${componentName} id="some-id" aria-labelledby="test-span"/></>`,
36+ // `<${labelComponent}>test</${labelComponent}>`,
37+ // `<${labelComponent}>test<${componentName} /></${labelComponent}>`,
38+ // `<${labelComponent}>test<SomeNesting><${componentName} /></SomeNesting></${labelComponent}>`,
39+ // `<Field label="this is my label"><${componentName} /></Field>`,
40+ // `<${componentName} aria-label="this is my component" />`,
41+ `<><${ labelComponent } id="paragraph_label-2">type here</${ labelComponent } ><${ componentName } aria-labelledby="paragraph_label-2"></${ componentName } ><${ labelComponent } id="paragraph_label-3">type here</${ labelComponent } ><${ componentName } aria-labelledby="paragraph_label-3"></${ componentName } ></>`
4142 ] ,
4243 invalid : [
43- {
44- code : `<><${ componentName } /></>` ,
45- errors : [ { messageId : "missingLabelOnInput" } ]
46- } ,
47- {
48- code : `<><${ labelComponent } /><${ componentName } /></>` ,
49- errors : [ { messageId : "missingLabelOnInput" } ]
50- } ,
51- {
52- code : `<><${ labelComponent } htmlFor="id"/><${ componentName } /></>` ,
53- errors : [ { messageId : "missingLabelOnInput" } ]
54- } ,
55- {
56- code : `<${ componentName } id="some-id"/>` ,
57- errors : [ { messageId : "missingLabelOnInput" } ]
58- } ,
59- {
60- code : `<><${ labelComponent } >Some Label</${ labelComponent } ><${ componentName } id="some-id"/></>` ,
61- errors : [ { messageId : "missingLabelOnInput" } ]
62- } ,
63- {
64- code : `<><Field></Field><${ componentName } id="some-id"/></>` ,
65- errors : [ { messageId : "missingLabelOnInput" } ]
66- }
44+ // {
45+ // code: `<><${componentName}/></>`,
46+ // errors: [{ messageId: "missingLabelOnInput" }]
47+ // },
48+ // {
49+ // code: `<><${labelComponent}/><${componentName}/></>`,
50+ // errors: [{ messageId: "missingLabelOnInput" }]
51+ // },
52+ // {
53+ // code: `<><${labelComponent} htmlFor="id"/><${componentName} /></>`,
54+ // errors: [{ messageId: "missingLabelOnInput" }]
55+ // },
56+ // {
57+ // code: `<${componentName} id="some-id"/>`,
58+ // errors: [{ messageId: "missingLabelOnInput" }]
59+ // },
60+ // {
61+ // code: `<><${labelComponent}>Some Label</${labelComponent}><${componentName} id="some-id"/></>`,
62+ // errors: [{ messageId: "missingLabelOnInput" }]
63+ // },
64+ // {
65+ // code: `<><Field></Field><${componentName} id="some-id"/></>`,
66+ // errors: [{ messageId: "missingLabelOnInput" }]
67+ // }
6768 ]
6869 } ;
6970}
@@ -72,13 +73,15 @@ function generateAllTestCases() {
7273 const testSets : any [ ] = [ ] ;
7374
7475 // For each input-based component, generate test cases
75- applicableComponents . forEach ( components => {
76- elementsUsedAsLabels . forEach ( labels => {
77- testSets . push ( generateTestCases ( labels , components ) ) ;
78- } ) ;
76+ [ "Input" ] . forEach ( components => {
77+ // applicableComponents.forEach(components => {
78+ // elementsUsedAsLabels.forEach(labels => {
79+ // testSets.push(generateTestCases(labels, components));
80+ // });
7981
8082 // Also generate test cases for each native DOM element
81- labelBasedComponents . forEach ( labels => {
83+ [ "Label" ] . forEach ( labels => {
84+ // labelBasedComponents.forEach(labels => {
8285 testSets . push ( generateTestCasesLabel ( labels , components ) ) ;
8386 } ) ;
8487 } ) ;
0 commit comments