feat(target-size-automation): Update target size requirement to be assisted #7331
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.
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
.