Repository navigation
fix(baseline): match findings whose selector only moved (0.18.6) - #52
Merged
Merged
Conversation
axe selectors can carry positional parts (li:nth-child(3)) and generated ids (#mat-input-3). A markup reorder changed them, so a known finding came back as new and failed the CI gate. diffAgainstBaseline now pairs by the exact key first, then pairs what is left by a looser key with those parts removed, for the same page, rule and owning component. Both passes count duplicates. findingKey is unchanged.
Review: the id pattern merged #h2 with #h3 and #col-12 with #col-13, and stripping inside :not() merged li:not(:first-child) with li:not(:last-child). Both would hide a real new finding. Tests for each case.
…:has Re-review: the lookbehind only protected a pseudo directly after :not(, so li:not(.x:first-child) still merged with li:not(.x:last-child). Positions are now stripped only outside selector functions. Tests for :not(.x:...), selector lists and :has().
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the baseline gate reporting a known finding as new when the markup around it was reordered.
Findings that don't match exactly get a second pass on a looser key. That key drops positional selector parts (
:nth-child(3),:first-childand the like) outside:not(),:is(),:where()and:has(). It also drops the trailing counter of a generated id with at least two words before the number (#mat-input-3,#cdk-overlay-12,#pn_id_3). Ids like#h2,#col-12and#item-2024are compared as written. Both passes count duplicates, so a real extra instance still shows as added.Trade-off, documented in the changelog: one instance fixed and another added in the same run, same rule and component, selectors differing only by position or id counter, pair as unchanged.
Version 0.18.6. 457 tests pass.