-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
test(combobox): add accessibility tests #3953
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
c1a7155
chore: add labels to combobox input
23f5adf
chore: get tests passing
f6a7b8a
test(combobox): get a11y tests passing
0764e85
chore: remove unused positionlistbox method
3b6398d
test: get tests passing, change spelling of activeDescendant
ea7f795
chore: missed some descendents
137c8b7
chore: add help text demo and test
4690011
ci: update hash
01f016f
chore: address review comments
c5ebe5d
chore: abstract shared data to index files
5ed38a9
test(combobox): update tests and stories to use legible data
28dabb1
ci: update hash
711e90a
chore: label menu and rename stories
935f4f2
ci: update hash
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,274 @@ | ||
/* | ||
Copyright 2024 Adobe. All rights reserved. | ||
This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. You may obtain a copy | ||
of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software distributed under | ||
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
OF ANY KIND, either express or implied. See the License for the specific language | ||
governing permissions and limitations under the License. | ||
*/ | ||
import { ComboboxOption } from '..'; | ||
|
||
export const countries: ComboboxOption[] = [ | ||
{ id: 'af', value: 'Afghanistan' }, | ||
{ id: 'ax', value: 'Aland Islands' }, | ||
{ id: 'al', value: 'Albania' }, | ||
{ id: 'dz', value: 'Algeria' }, | ||
{ id: 'as', value: 'American Samoa' }, | ||
{ id: 'ad', value: 'Andorra' }, | ||
{ id: 'ao', value: 'Angola' }, | ||
{ id: 'ai', value: 'Anguilla' }, | ||
{ id: 'aq', value: 'Antarctica' }, | ||
{ id: 'ag', value: 'Antigua and Barbuda' }, | ||
{ id: 'ar', value: 'Argentina' }, | ||
{ id: 'ar', value: 'Armenia' }, | ||
{ id: 'aw', value: 'Aruba' }, | ||
{ id: 'au', value: 'Australia' }, | ||
{ id: 'at', value: 'Austria' }, | ||
{ id: 'az', value: 'Azerbaijan' }, | ||
{ id: 'bs', value: 'Bahamas' }, | ||
{ id: 'bh', value: 'Bahrain' }, | ||
{ id: 'bd', value: 'Bangladesh' }, | ||
{ id: 'bb', value: 'Barbados' }, | ||
{ id: 'by', value: 'Belarus' }, | ||
{ id: 'be', value: 'Belgium' }, | ||
{ id: 'bz', value: 'Belize' }, | ||
{ id: 'bj', value: 'Benin' }, | ||
{ id: 'bm', value: 'Bermuda' }, | ||
{ id: 'bt', value: 'Bhutan' }, | ||
{ id: 'bo', value: 'Bolivia' }, | ||
{ id: 'ba', value: 'Bosnia and Herzegovina' }, | ||
{ id: 'bw', value: 'Botswana' }, | ||
{ id: 'bv', value: 'Bouvet Island' }, | ||
{ id: 'br', value: 'Brazil' }, | ||
{ id: 'io', value: 'British Indian Ocean Territory' }, | ||
{ id: 'bn', value: 'Brunei Darussalam' }, | ||
{ id: 'bg', value: 'Bulgaria' }, | ||
{ id: 'bf', value: 'Burkina Faso' }, | ||
{ id: 'bi', value: 'Burundi' }, | ||
{ id: 'kh', value: 'Cambodia' }, | ||
{ id: 'cm', value: 'Cameroon' }, | ||
{ id: 'ca', value: 'Canada' }, | ||
{ id: 'cv', value: 'Cape Verde' }, | ||
{ id: 'ky', value: 'Cayman Islands' }, | ||
{ id: 'cf', value: 'Central African Republic' }, | ||
{ id: 'td', value: 'Chad' }, | ||
{ id: 'cl', value: 'Chile' }, | ||
{ id: 'cn', value: 'China' }, | ||
{ id: 'cx', value: 'Christmas Island' }, | ||
{ id: 'cc', value: 'Cocos (Keeling) Islands' }, | ||
{ id: 'co', value: 'Colombia' }, | ||
{ id: 'km', value: 'Comoros' }, | ||
{ id: 'cg', value: 'Congo' }, | ||
{ id: 'cd', value: 'Congo, The Democratic Republic of the' }, | ||
{ id: 'ck', value: 'Cook Islands' }, | ||
{ id: 'cr', value: 'Costa Rica' }, | ||
{ id: 'ci', value: "Cote D'Ivoire" }, | ||
{ id: 'hr', value: 'Croatia' }, | ||
{ id: 'cu', value: 'Cuba' }, | ||
{ id: 'cy', value: 'Cyprus' }, | ||
{ id: 'cz', value: 'Czech Republic' }, | ||
{ id: 'dk', value: 'Denmark' }, | ||
{ id: 'dj', value: 'Djibouti' }, | ||
{ id: 'dm', value: 'Dominica' }, | ||
{ id: 'do', value: 'Dominican Republic' }, | ||
{ id: 'ec', value: 'Ecuador' }, | ||
{ id: 'eg', value: 'Egypt' }, | ||
{ id: 'sv', value: 'El Salvador' }, | ||
{ id: 'gq', value: 'Equatorial Guinea' }, | ||
{ id: 'er', value: 'Eritrea' }, | ||
{ id: 'ee', value: 'Estonia' }, | ||
{ id: 'et', value: 'Ethiopia' }, | ||
{ id: 'fk', value: 'Falkland Islands (Malvinas)' }, | ||
{ id: 'fo', value: 'Faroe Islands' }, | ||
{ id: 'fj', value: 'Fiji' }, | ||
{ id: 'fi', value: 'Finland' }, | ||
{ id: 'fr', value: 'France' }, | ||
{ id: 'gf', value: 'French Guiana' }, | ||
{ id: 'pf', value: 'French Polynesia' }, | ||
{ id: 'tf', value: 'French Southern Territories' }, | ||
{ id: 'ga', value: 'Gabon' }, | ||
{ id: 'gm', value: 'Gambia' }, | ||
{ id: 'ge', value: 'Georgia' }, | ||
{ id: 'de', value: 'Germany' }, | ||
{ id: 'gh', value: 'Ghana' }, | ||
{ id: 'gi', value: 'Gibraltar' }, | ||
{ id: 'gr', value: 'Greece' }, | ||
{ id: 'gl', value: 'Greenland' }, | ||
{ id: 'gd', value: 'Grenada' }, | ||
{ id: 'gp', value: 'Guadeloupe' }, | ||
{ id: 'gu', value: 'Guam' }, | ||
{ id: 'gt', value: 'Guatemala' }, | ||
{ id: 'gg', value: 'Guernsey' }, | ||
{ id: 'gn', value: 'Guinea' }, | ||
{ id: 'gw', value: 'Guinea-Bissau' }, | ||
{ id: 'gy', value: 'Guyana' }, | ||
{ id: 'ht', value: 'Haiti' }, | ||
{ id: 'hm', value: 'Heard Island and Mcdonald Islands' }, | ||
{ id: 'va', value: 'Holy See (Vatican City State)' }, | ||
{ id: 'hn', value: 'Honduras' }, | ||
{ id: 'hk', value: 'Hong Kong' }, | ||
{ id: 'hu', value: 'Hungary' }, | ||
{ id: 'is', value: 'Iceland' }, | ||
{ id: 'in', value: 'India' }, | ||
{ id: 'id', value: 'Indonesia' }, | ||
{ id: 'ir', value: 'Iran, Islamic Republic Of' }, | ||
{ id: 'iq', value: 'Iraq' }, | ||
{ id: 'ie', value: 'Ireland' }, | ||
{ id: 'im', value: 'Isle of Man' }, | ||
{ id: 'il', value: 'Israel' }, | ||
{ id: 'it', value: 'Italy' }, | ||
{ id: 'jm', value: 'Jamaica' }, | ||
{ id: 'jp', value: 'Japan' }, | ||
{ id: 'je', value: 'Jersey' }, | ||
{ id: 'jo', value: 'Jordan' }, | ||
{ id: 'kz', value: 'Kazakhstan' }, | ||
{ id: 'ke', value: 'Kenya' }, | ||
{ id: 'ki', value: 'Kiribati' }, | ||
{ id: 'kp', value: "Korea, Democratic People's Republic of" }, | ||
{ id: 'kr', value: 'Korea, Republic of' }, | ||
{ id: 'kw', value: 'Kuwait' }, | ||
{ id: 'kg', value: 'Kyrgyzstan' }, | ||
{ id: 'la', value: 'Laos' }, | ||
{ id: 'lv', value: 'Latvia' }, | ||
{ id: 'lb', value: 'Lebanon' }, | ||
{ id: 'ls', value: 'Lesotho' }, | ||
{ id: 'lr', value: 'Liberia' }, | ||
{ id: 'ly', value: 'Libyan Arab Jamahiriya' }, | ||
{ id: 'li', value: 'Liechtenstein' }, | ||
{ id: 'lt', value: 'Lithuania' }, | ||
{ id: 'lu', value: 'Luxembourg' }, | ||
{ id: 'mo', value: 'Macao' }, | ||
{ id: 'mk', value: 'Macedonia, The Former Yugoslav Republic of' }, | ||
{ id: 'mg', value: 'Madagascar' }, | ||
{ id: 'mw', value: 'Malawi' }, | ||
{ id: 'my', value: 'Malaysia' }, | ||
{ id: 'mv', value: 'Maldives' }, | ||
{ id: 'ml', value: 'Mali' }, | ||
{ id: 'mt', value: 'Malta' }, | ||
{ id: 'mh', value: 'Marshall Islands' }, | ||
{ id: 'mq', value: 'Martinique' }, | ||
{ id: 'mr', value: 'Mauritania' }, | ||
{ id: 'mu', value: 'Mauritius' }, | ||
{ id: 'yt', value: 'Mayotte' }, | ||
{ id: 'mx', value: 'Mexico' }, | ||
{ id: 'fm', value: 'Micronesia, Federated States of' }, | ||
{ id: 'md', value: 'Moldova, Republic of' }, | ||
{ id: 'mc', value: 'Monaco' }, | ||
{ id: 'mn', value: 'Mongolia' }, | ||
{ id: 'me', value: 'Montenegro' }, | ||
{ id: 'ms', value: 'Montserrat' }, | ||
{ id: 'ma', value: 'Morocco' }, | ||
{ id: 'mz', value: 'Mozambique' }, | ||
{ id: 'mm', value: 'Myanmar' }, | ||
{ id: 'na', value: 'Namibia' }, | ||
{ id: 'nr', value: 'Nauru' }, | ||
{ id: 'np', value: 'Nepal' }, | ||
{ id: 'nl', value: 'Netherlands' }, | ||
{ id: 'an', value: 'Netherlands Antilles' }, | ||
{ id: 'nc', value: 'New Caledonia' }, | ||
{ id: 'nz', value: 'New Zealand' }, | ||
{ id: 'ni', value: 'Nicaragua' }, | ||
{ id: 'ne', value: 'Niger' }, | ||
{ id: 'ng', value: 'Nigeria' }, | ||
{ id: 'nu', value: 'Niue' }, | ||
{ id: 'nf', value: 'Norfolk Island' }, | ||
{ id: 'mp', value: 'Northern Mariana Islands' }, | ||
{ id: 'no', value: 'Norway' }, | ||
{ id: 'om', value: 'Oman' }, | ||
{ id: 'pk', value: 'Pakistan' }, | ||
{ id: 'pw', value: 'Palau' }, | ||
{ id: 'ps', value: 'Palestinian Territory, Occupied' }, | ||
{ id: 'pa', value: 'Panama' }, | ||
{ id: 'pg', value: 'Papua New Guinea' }, | ||
{ id: 'py', value: 'Paraguay' }, | ||
{ id: 'pe', value: 'Peru' }, | ||
{ id: 'ph', value: 'Philippines' }, | ||
{ id: 'pn', value: 'Pitcairn' }, | ||
{ id: 'pl', value: 'Poland' }, | ||
{ id: 'pt', value: 'Portugal' }, | ||
{ id: 'pr', value: 'Puerto Rico' }, | ||
{ id: 'qa', value: 'Qatar' }, | ||
{ id: 're', value: 'Reunion' }, | ||
{ id: 'ro', value: 'Romania' }, | ||
{ id: 'ru', value: 'Russian Federation' }, | ||
{ id: 'rw', value: 'RWANDA' }, | ||
{ id: 'sh', value: 'Saint Helena' }, | ||
{ id: 'kn', value: 'Saint Kitts and Nevis' }, | ||
{ id: 'lc', value: 'Saint Lucia' }, | ||
{ id: 'pm', value: 'Saint Pierre and Miquelon' }, | ||
{ id: 'vc', value: 'Saint Vincent and the Grenadines' }, | ||
{ id: 'ws', value: 'Samoa' }, | ||
{ id: 'sm', value: 'San Marino' }, | ||
{ id: 'st', value: 'Sao Tome and Principe' }, | ||
{ id: 'sa', value: 'Saudi Arabia' }, | ||
{ id: 'sn', value: 'Senegal' }, | ||
{ id: 'rs', value: 'Serbia' }, | ||
{ id: 'sc', value: 'Seychelles' }, | ||
{ id: 'sl', value: 'Sierra Leone' }, | ||
{ id: 'sg', value: 'Singapore' }, | ||
{ id: 'sk', value: 'Slovakia' }, | ||
{ id: 'si', value: 'Slovenia' }, | ||
{ id: 'sb', value: 'Solomon Islands' }, | ||
{ id: 'so', value: 'Somalia' }, | ||
{ id: 'za', value: 'South Africa' }, | ||
{ id: 'gs', value: 'South Georgia and the South Sandwich Islands' }, | ||
{ id: 'es', value: 'Spain' }, | ||
{ id: 'lk', value: 'Sri Lanka' }, | ||
{ id: 'sd', value: 'Sudan' }, | ||
{ id: 'sr', value: 'Suriname' }, | ||
{ id: 'sj', value: 'Svalbard and Jan Mayen' }, | ||
{ id: 'sz', value: 'Swaziland' }, | ||
{ id: 'se', value: 'Sweden' }, | ||
{ id: 'ch', value: 'Switzerland' }, | ||
{ id: 'sy', value: 'Syrian Arab Republic' }, | ||
{ id: 'tw', value: 'Taiwan' }, | ||
{ id: 'tj', value: 'Tajikistan' }, | ||
{ id: 'tz', value: 'Tanzania, United Republic of' }, | ||
{ id: 'th', value: 'Thailand' }, | ||
{ id: 'tl', value: 'Timor-Leste' }, | ||
{ id: 'tg', value: 'Togo' }, | ||
{ id: 'tk', value: 'Tokelau' }, | ||
{ id: 'to', value: 'Tonga' }, | ||
{ id: 'tt', value: 'Trinidad and Tobago' }, | ||
{ id: 'tn', value: 'Tunisia' }, | ||
{ id: 'tr', value: 'Turkey' }, | ||
{ id: 'tm', value: 'Turkmenistan' }, | ||
{ id: 'tc', value: 'Turks and Caicos Islands' }, | ||
{ id: 'tv', value: 'Tuvalu' }, | ||
{ id: 'ug', value: 'Uganda' }, | ||
{ id: 'ua', value: 'Ukraine' }, | ||
{ id: 'ae', value: 'United Arab Emirates' }, | ||
{ id: 'gb', value: 'United Kingdom' }, | ||
{ id: 'us', value: 'United States' }, | ||
{ id: 'um', value: 'United States Minor Outlying Islands' }, | ||
{ id: 'uy', value: 'Uruguay' }, | ||
{ id: 'uz', value: 'Uzbekistan' }, | ||
{ id: 'vu', value: 'Vanuatu' }, | ||
{ id: 've', value: 'Venezuela' }, | ||
{ id: 'vn', value: 'Vietnam' }, | ||
{ id: 'vg', value: 'Virgin Islands, British' }, | ||
{ id: 'vi', value: 'Virgin Islands, U.S.' }, | ||
{ id: 'wf', value: 'Wallis and Futuna' }, | ||
{ id: 'eh', value: 'Western Sahara' }, | ||
{ id: 'ye', value: 'Yemen' }, | ||
{ id: 'zm', value: 'Zambia' }, | ||
{ id: 'zw', value: 'Zimbabwe' }, | ||
]; | ||
|
||
export const fruits: ComboboxOption[] = [ | ||
{ id: 'apple', value: 'Apple' }, | ||
{ id: 'banana', value: 'Banana' }, | ||
{ id: 'cherry', value: 'Cherry' }, | ||
{ id: 'coconut', value: 'Coconut' }, | ||
{ id: 'durian', value: 'Durian' }, | ||
{ id: 'lemon', value: 'Lemon' }, | ||
{ id: 'lychee', value: 'Lychee' }, | ||
{ id: 'mango', value: 'Mango' }, | ||
{ id: 'orange', value: 'Orange' }, | ||
{ id: 'peach', value: 'Peach' }, | ||
{ id: 'pear', value: 'Pear' }, | ||
{ id: 'persimmon', value: 'Persimmon' }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed this var name because it felt too generic.