| name | accessibility-test-selection |
| description | Determines which accessibility tests from the test library apply to a VA Design System component based on its features and implementation. |
Accessibility Test Selection
This skill helps identify which accessibility tests from the VA Design System test library apply to a specific component.
Primary Documentation Source
All test selection rules, subtest priority guidelines, and component-type checklists are documented in:
src/_data/accessibility-tests/components/README.md
Required reading sections:
- Test Selection Guidelines → Subtest Preference Rule — Rules for preferring specific subtests over parent tests, how to find subtests in YAML files
- Choosing tests by component type — Complete category-by-category test checklists for all component types
Additional Documentation
Test Library Structure
Read these to understand test definitions, IDs, and configuration:
-
src/_data/accessibility-tests/test-library/README.md
- Test ID format and structure
- WCAG mappings
- Test categories and required environments
- How to read test entries
-
src/_data/accessibility-tests/test-library/_config.yml
- Environment ID definitions (see
environments: section)
- Category definitions (see
categories: section)
- Required environments per category (e.g.,
screen_reader, mobile)
-
src/_data/accessibility-tests/README.md
- High-level overview of the test library
- Directory structure
- Links to related documentation
Test Definition Files
Tests are organized by WCAG principle:
src/_data/accessibility-tests/test-library/1-perceivable.yml
src/_data/accessibility-tests/test-library/2-operable.yml
src/_data/accessibility-tests/test-library/3-understandable.yml
src/_data/accessibility-tests/test-library/4-robust.yml
To find subtests: Open these YAML files and look for subtests: arrays under each parent test entry.
Example Component Test Files
Reference these for patterns:
src/_data/accessibility-tests/components/va-link.yml — Simple interactive component
src/_data/accessibility-tests/components/va-text-input.yml — Form input
src/_data/accessibility-tests/components/va-accordion.yml — Dynamic content
Agent workflow
When invoked to select tests for a component:
-
Read the components README at src/_data/accessibility-tests/components/README.md
-
Follow the "Test Selection Guidelines" section, which includes:
- How to analyze your component
- Subtest preference rule
- Child component inheritance
- Determining required test environments
-
Apply the "Choosing tests by component type" guidelines to select applicable tests based on component features
-
Return the complete list of test IDs:
- Sorted numerically by test ID
- No duplicates
- Specific subtests used instead of parent tests where applicable
- Include note about required environments for tests with
screen_reader or mobile categories
Related Prompts
File Paths Quick Reference
Component Test Files
- Directory:
src/_data/accessibility-tests/components/
- Pattern:
va-[component-name].yml
- Examples:
va-button.yml, va-text-input.yml, va-accordion.yml
Test Library Files
- Directory:
src/_data/accessibility-tests/test-library/
- Test definitions:
1-perceivable.yml (WEB-1xx tests)
2-operable.yml (WEB-2xx tests)
3-understandable.yml (WEB-3xx tests)
4-robust.yml (WEB-4xx tests)
- Configuration:
_config.yml (environments, categories, required environments)
- README:
README.md (test structure, writing guidelines, WCAG mappings)
Component Source Code
- Repository:
https://github.com/department-of-veterans-affairs/component-library
- Path:
packages/web-components/src/components/
- Pattern:
va-[component-name]/va-[component-name].tsx
Implementation Notes
When to Use This Skill
- Creating a new component test file
- Reviewing an existing component test file for completeness
- Answering "what tests should apply to this component?"
- Auditing test coverage across components
When NOT to Use This Skill
- Test result recording — Use components README "Recording Test Results" section instead
- Writing test library entries — Use the writing-entries skill instead
- Understanding WCAG mappings — Read test-library README directly
- Interpreting test results — This skill selects tests, doesn't validate or interpret results
Assumptions and Edge Cases
- Component-specific context required: Cannot select tests without knowing component features
- False positives preferred: When uncertain, include the test (missing coverage is worse than extra tests)
- Child component inheritance: Parent components should include all applicable tests from their children
- Implementation-dependent tests: Some tests (e.g.,
WEB-244 Link Purpose) may need to be marked "conditional" if they can only be tested in implementation context
Output Format
When returning test selections, provide:
- Complete list of test IDs (sorted numerically)
- Category groupings (optional, for readability) showing which category each test came from
- Required environments note for tests with
screen_reader or mobile categories
- Rationale (brief) for why each test applies to the component
Example output:
Test IDs for va-button:
All components:
- WEB-134 (Orientation)
- WEB-1410 (Reflow)
Components with text:
- WEB-143 (Contrast - Minimum)
- WEB-144 (Resize Text)
- WEB-1412 (Text Spacing)
All interactive elements:
- VADS-211-002 (Keyboard - form inputs) [Note: button is technically a form control]
- WEB-1411 (Non-text Contrast) [has subtests - check if specific ones apply]
- WEB-212 (No Keyboard Trap)
- WEB-243 (Focus Order)
- WEB-247 (Focus Visible)
- WEB-2411 (Focus Not Obscured)
- VADS-253-001 (Label in Name - screen reader)
- VADS-258-001 (Target Size - mobile) [required environments: android-chrome, ios-safari]
- WEB-321 (On Focus)
- WEB-412 (Name, Role, Value) [has subtests - check if specific ones apply]
Buttons:
- WEB-412-002 (State announcements) — if button has state
- WEB-412-003 (Proper element types)
- VADS-412-002 (Button actions)
Total: [number] tests
Questions?
Contact the Design System team in #platform-design-system Slack channel.