@@ -35,6 +35,10 @@ const errorMessage = (name) => {
35
35
case 'tokenlist' :
36
36
return `The value for ${ name } must be a list of one or more \
37
37
tokens from the following: ${ permittedValues } .` ;
38
+ case 'idlist' :
39
+ return `The value for ${ name } must be a list of strings that represent DOM element IDs (idlist)` ;
40
+ case 'id' :
41
+ return `The value for ${ name } must be a string that represents a DOM element ID` ;
38
42
case 'boolean' :
39
43
case 'string' :
40
44
case 'integer' :
@@ -155,6 +159,40 @@ ruleTester.run('aria-proptypes', rule, {
155
159
{ code : '<div aria-relevant={`removals additions text all`} />' } ,
156
160
{ code : '<div aria-relevant={foo} />' } ,
157
161
{ code : '<div aria-relevant={foo.bar} />' } ,
162
+
163
+ // ID
164
+ { code : '<div aria-activedescendant="ascending" />' } ,
165
+ { code : '<div aria-activedescendant="ASCENDING" />' } ,
166
+ { code : '<div aria-activedescendant={"ascending"} />' } ,
167
+ { code : '<div aria-activedescendant={`ascending`} />' } ,
168
+ { code : '<div aria-activedescendant="descending" />' } ,
169
+ { code : '<div aria-activedescendant={"descending"} />' } ,
170
+ { code : '<div aria-activedescendant={`descending`} />' } ,
171
+ { code : '<div aria-activedescendant="none" />' } ,
172
+ { code : '<div aria-activedescendant={"none"} />' } ,
173
+ { code : '<div aria-activedescendant={`none`} />' } ,
174
+ { code : '<div aria-activedescendant="other" />' } ,
175
+ { code : '<div aria-activedescendant={"other"} />' } ,
176
+ { code : '<div aria-activedescendant={`other`} />' } ,
177
+ { code : '<div aria-activedescendant={foo} />' } ,
178
+ { code : '<div aria-activedescendant={foo.bar} />' } ,
179
+
180
+ // IDLIST
181
+ { code : '<div aria-labelledby="additions" />' } ,
182
+ { code : '<div aria-labelledby={"additions"} />' } ,
183
+ { code : '<div aria-labelledby={`additions`} />' } ,
184
+ { code : '<div aria-labelledby="additions removals" />' } ,
185
+ { code : '<div aria-labelledby="additions additions" />' } ,
186
+ { code : '<div aria-labelledby={"additions removals"} />' } ,
187
+ { code : '<div aria-labelledby={`additions removals`} />' } ,
188
+ { code : '<div aria-labelledby="additions removals text" />' } ,
189
+ { code : '<div aria-labelledby={"additions removals text"} />' } ,
190
+ { code : '<div aria-labelledby={`additions removals text`} />' } ,
191
+ { code : '<div aria-labelledby="additions removals text all" />' } ,
192
+ { code : '<div aria-labelledby={"additions removals text all"} />' } ,
193
+ { code : '<div aria-labelledby={`removals additions text all`} />' } ,
194
+ { code : '<div aria-labelledby={foo} />' } ,
195
+ { code : '<div aria-labelledby={foo.bar} />' } ,
158
196
] . map ( parserOptionsMapper ) ,
159
197
invalid : [
160
198
// BOOLEAN
0 commit comments