@@ -18,22 +18,20 @@ const validAriaRole = <button role="slider" />;
18
18
const signalBadAriaRole = (
19
19
// @ts -expect-error A button should not have a role of presentation
20
20
< button role = { createSignal ( 'presentation' as const ) } />
21
- )
22
- const signalValidAriaRole = (
23
- < button role = { createSignal ( 'slider' as const ) } />
24
- )
21
+ ) ;
22
+ const signalValidAriaRole = < button role = { createSignal ( 'slider' as const ) } /> ;
25
23
26
24
// @ts -expect-error A map should never have any role set
27
25
const invalidAriaRole = < map role = "presentation" /> ;
28
26
const signalInvalidAriaRole = (
29
27
// @ts -expect-error A map should never have any role set
30
28
< button role = { createSignal ( 'presentation' as const ) } />
31
- )
32
- const validMissingAriaRole = < base href = "" > </ base >
29
+ ) ;
30
+ const validMissingAriaRole = < base href = "" > </ base > ;
33
31
const signalValidMissingAriaRole = (
34
32
// @ts -expect-error A map should never have any role set
35
33
< button role = { createSignal ( 'presentation' as const ) } />
36
- )
34
+ ) ;
37
35
38
36
// More complex role tests w/ unions
39
37
@@ -43,7 +41,6 @@ const aWithHrefInvalid = <a href="foo" role="slider"></a>;
43
41
44
42
const aWithoutHrefValid = < a role = "button" > </ a > ;
45
43
46
-
47
44
const areaWithHrefValid = < area href = "foo" role = "link" > </ area > ;
48
45
// @ts -expect-error An area with an href should not have a role of button
49
46
const areaWithHrefInvalid = < area href = "foo" role = "button" > </ area > ;
@@ -52,15 +49,22 @@ const areaWithoutHrefValid = <area role="button"></area>;
52
49
// @ts -expect-error An area with an href should not have a role of button
53
50
const areaWithoutHrefInvalid = < area role = "slider" > </ area > ;
54
51
55
-
56
- const imgWithAccessibleNameAriaLabelValid = < img aria-label = "foo" role = "button" /> ;
57
- const imgWithAccessibleNameAriaLabelledByValid = < img aria-labelledby = "foo" role = "button" /> ;
52
+ const imgWithAccessibleNameAriaLabelValid = (
53
+ < img aria-label = "foo" role = "button" />
54
+ ) ;
55
+ const imgWithAccessibleNameAriaLabelledByValid = (
56
+ < img aria-labelledby = "foo" role = "button" />
57
+ ) ;
58
58
const imgWithAccessibleNameAltValid = < img alt = "foo" role = "button" /> ;
59
59
const imgWithAccessibleNameTitleValid = < img title = "foo" role = "button" /> ;
60
- // @ts -expect-error An img with an accessible name should not have a role of presentation
61
- const imgWithAccessibleNameAriaLabelInvalid = < img aria-label = "foo" role = "presentation" /> ;
62
- // @ts -expect-error An img with an accessible name should not have a role of presentation
63
- const imgWithAccessibleNameAriaLabelledByInvalid = < img aria-labelledby = "foo" role = "presentation" /> ;
60
+ const imgWithAccessibleNameAriaLabelInvalid = (
61
+ // @ts -expect-error An img with an accessible name should not have a role of presentation
62
+ < img aria-label = "foo" role = "presentation" />
63
+ ) ;
64
+ const imgWithAccessibleNameAriaLabelledByInvalid = (
65
+ // @ts -expect-error An img with an accessible name should not have a role of presentation
66
+ < img aria-labelledby = "foo" role = "presentation" />
67
+ ) ;
64
68
// @ts -expect-error An img with an accessible name should not have a role of presentation
65
69
const imgWithAccessibleNameAltInvalid = < img alt = "foo" role = "presentation" /> ;
66
70
// @ts -expect-error An img with an accessible name should not have a role of presentation
@@ -70,12 +74,13 @@ const imgWithoutAccessibleNameValid = <img role="presentation" />;
70
74
// @ts -expect-error An img without an accessible name should not have a role of button
71
75
const imgWithoutAccessibleNameInvalid = < img role = "button" /> ;
72
76
73
-
74
77
const inputTypeButtonValid = < input type = "button" role = "checkbox" /> ;
75
78
// @ts -expect-error An input of type button should not have a role of presentation
76
79
const inputTypeButtonInvalid = < input type = "button" role = "presentation" /> ;
77
80
78
- const inputTypeCheckboxValid = < input type = "checkbox" role = "menuitemcheckbox" /> ;
81
+ const inputTypeCheckboxValid = (
82
+ < input type = "checkbox" role = "menuitemcheckbox" />
83
+ ) ;
79
84
// @ts -expect-error An input of type checkbox should not have a role of presentation
80
85
const inputTypeCheckboxInvalid = < input type = "checkbox" role = "presentation" /> ;
81
86
@@ -88,8 +93,10 @@ const inputTypeDateValid = <input type="date" />;
88
93
const inputTypeDateInvalid = < input type = "date" role = "button" /> ;
89
94
90
95
const inputTypeDatetimeLocalValid = < input type = "datetime-local" /> ;
91
- // @ts -expect-error An input of type datetime-local should not have a role
92
- const inputTypeDatetimeLocalInvalid = < input type = "datetime-local" role = "button" /> ;
96
+ const inputTypeDatetimeLocalInvalid = (
97
+ // @ts -expect-error An input of type datetime-local should not have a role
98
+ < input type = "datetime-local" role = "button" />
99
+ ) ;
93
100
94
101
const inputTypeEmailValid = < input type = "email" role = "textbox" /> ;
95
102
// @ts -expect-error An input of type email, without a list attribute, should not have a role of button
@@ -151,11 +158,15 @@ const inputTypeOmittedValid = <input role="combobox" />;
151
158
// @ts -expect-error An input of type text should not have a role of presentation
152
159
const inputTypeOmittedInvalid = < input role = "presentation" /> ;
153
160
154
- const inputTypeEmailListValid = < input type = "email" list = "foo" role = "combobox" /> ;
161
+ const inputTypeEmailListValid = (
162
+ < input type = "email" list = "foo" role = "combobox" />
163
+ ) ;
155
164
// @ts -expect-error An input of type email, with a list attribute, should not have a role of button
156
165
const inputTypeEmailListInvalid = < input type = "email" role = "button" /> ;
157
166
158
- const inputTypeSearchListValid = < input type = "search" list = "foo" role = "combobox" /> ;
167
+ const inputTypeSearchListValid = (
168
+ < input type = "search" list = "foo" role = "combobox" />
169
+ ) ;
159
170
// @ts -expect-error An input of type search, with a list attribute, should not have a role of button
160
171
const inputTypeSearchListInvalid = < input type = "search" role = "button" /> ;
161
172
@@ -167,7 +178,9 @@ const inputTypeTextListValid = <input type="text" list="foo" role="combobox" />;
167
178
// @ts -expect-error An input of type text, with a list attribute, should not have a role of button
168
179
const inputTypeTextListInvalid = < input type = "text" role = "button" /> ;
169
180
170
- const inputTypeOmittedListValid = < input type = "text" list = "foo" role = "combobox" /> ;
181
+ const inputTypeOmittedListValid = (
182
+ < input type = "text" list = "foo" role = "combobox" />
183
+ ) ;
171
184
// @ts -expect-error An input of type text, with a list attribute, should not have a role of button
172
185
const inputTypeOmittedListInvalid = < input type = "text" role = "button" /> ;
173
186
@@ -199,8 +212,6 @@ const selectSizeValid = <select size={5} role="listbox" />;
199
212
// @ts -expect-error A select with a size other than `0` or `1` should not have a role of menu
200
213
const selectSizeInvalid = < select size = { 5 } role = "menu" /> ;
201
214
202
-
203
-
204
215
// @ts -expect-error We should correctly type aria attributes like autocomplete
205
216
const badAriaValues = < div aria-autocomplete = "bad-value" /> ;
206
217
const validAriaValues = < div aria-autocomplete = "none" /> ;
0 commit comments