accessibility-insights-web
accessibility-insights-web copied to clipboard
feat(target-size-automation): Update target size requirement to be assisted
Details
This updates the Target Size requirement in the Pointer Motion assessment to use the new 'target-size' axe-core rule and display the results in an instances table.
The needs for the instances table are a little different than what has been needed for similar requirements in the past:
- it runs two checks under the hood that have properties in common, meaning that data is overwritten when they both run on an instance. additional code was needed to ensure data from both the
target-sizeand thetarget-offsetchecks was included.- created the
generateTargetSizePropertyBagFromfunction and added it to theRequirementtype to be used inAssessmentDataConverter.
- created the
- the data getting shown to the user is all text, so the text needs some styling to enable the user to quickly scan the instances table and make decisions.
TargetSizeColumnRenderergenerates the stylized text component based on theitem'spropertyBag.TargetSizeColumnRendererFactoryis used inside the Requirement to make this happen.getTargetSizeMessageComponentFromPropertyBagandgetTargetOffsetMessageComponentFromPropertyBagfunctions that are used under the hood inTargetSizeColumnRendererare used directly in the Requirement'sreportInstanceFields.
- A new
resultProcessor(scanner.getAllApplicableInstances) was created for this instances table, as we needpass,fail, andincompleteinstances for the user, not just completed instances.
In order to test this locally, test resources have been added at src/tests/end-to-end/test-resources/target-size.
Motivation
feature work
Context
Right now, this PR includes cursory tests for the TargetSizeColumnRendererFactory and TargetSizeColumnRenderer but other new functionality does not have corresponding unit tests.
Additional work will be done to add target-size as a needs review rule and to add additional telemetry for this requirement.
Pull request checklist
- [ ] Addresses an existing issue: #0000
- [ ] Ran
yarn fastpass - [ ] Added/updated relevant unit test(s) (and ran
yarn test) - [ ] Verified code coverage for the changes made. Check coverage report at:
<rootDir>/test-results/unit/coverage - [ ] PR title AND final merge commit title both start with a semantic tag (
fix:,chore:,feat(feature-name):,refactor:). SeeCONTRIBUTING.md. - [ ] (UI changes only) Added screenshots/GIFs to description above
- [ ] (UI changes only) Verified usability with NVDA/JAWS