@@ -35,6 +35,10 @@ const errorMessage = (name) => {
3535 case 'tokenlist' :
3636 return `The value for ${ name } must be a list of one or more \
3737tokens 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` ;
3842 case 'boolean' :
3943 case 'string' :
4044 case 'integer' :
@@ -155,6 +159,40 @@ ruleTester.run('aria-proptypes', rule, {
155159 { code : '<div aria-relevant={`removals additions text all`} />' } ,
156160 { code : '<div aria-relevant={foo} />' } ,
157161 { 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} />' } ,
158196 ] . map ( parserOptionsMapper ) ,
159197 invalid : [
160198 // BOOLEAN
0 commit comments