@@ -31,39 +31,40 @@ function generateTestCases(labelComponent: string, componentName: string) {
31
31
function generateTestCasesLabel ( labelComponent : string , componentName : string ) {
32
32
return {
33
33
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 } ></>`
41
42
] ,
42
43
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
+ // }
67
68
]
68
69
} ;
69
70
}
@@ -72,13 +73,15 @@ function generateAllTestCases() {
72
73
const testSets : any [ ] = [ ] ;
73
74
74
75
// 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
+ // });
79
81
80
82
// Also generate test cases for each native DOM element
81
- labelBasedComponents . forEach ( labels => {
83
+ [ "Label" ] . forEach ( labels => {
84
+ // labelBasedComponents.forEach(labels => {
82
85
testSets . push ( generateTestCasesLabel ( labels , components ) ) ;
83
86
} ) ;
84
87
} ) ;
0 commit comments