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-size and the target-offset checks was included.
created the generateTargetSizePropertyBagFrom function and added it to the Requirement type to be used in AssessmentDataConverter.
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.
TargetSizeColumnRenderer generates the stylized text component based on the item's propertyBag. TargetSizeColumnRendererFactory is used inside the Requirement to make this happen.
getTargetSizeMessageComponentFromPropertyBag and getTargetOffsetMessageComponentFromPropertyBag functions that are used under the hood in TargetSizeColumnRenderer are used directly in the Requirement's reportInstanceFields.
A new resultProcessor (scanner.getAllApplicableInstances) was created for this instances table, as we need pass, fail, and incomplete instances 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:). See CONTRIBUTING.md.
[ ] (UI changes only) Added screenshots/GIFs to description above
[ ] (UI changes only) Verified usability with NVDA/JAWS
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:
target-size
and thetarget-offset
checks was included.generateTargetSizePropertyBagFrom
function and added it to theRequirement
type to be used inAssessmentDataConverter
.TargetSizeColumnRenderer
generates the stylized text component based on theitem
'spropertyBag
.TargetSizeColumnRendererFactory
is used inside the Requirement to make this happen.getTargetSizeMessageComponentFromPropertyBag
andgetTargetOffsetMessageComponentFromPropertyBag
functions that are used under the hood inTargetSizeColumnRenderer
are used directly in the Requirement'sreportInstanceFields
.resultProcessor
(scanner.getAllApplicableInstances
) was created for this instances table, as we needpass
,fail
, andincomplete
instances 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
andTargetSizeColumnRenderer
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
yarn fastpass
yarn test
)<rootDir>/test-results/unit/coverage
fix:
,chore:
,feat(feature-name):
,refactor:
). SeeCONTRIBUTING.md
.