Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rule): add check node to the check result object #2608

Merged
merged 1 commit into from
Oct 29, 2020
Merged

Conversation

straker
Copy link
Contributor

@straker straker commented Oct 28, 2020

This was more difficult than I had hoped. The functions all mutate the original results through various passes, which meant that I couldn't return a new object as the final filter of item.filtered === true had to run on the original result.nodes. I'm not a fan of how we're doing it, but it would take a huge refactor to get it to work differently, and an even bigger understanding of why we are doing what we are doing.

I then tried to just add the node object directly to the check result, but that resulted in the final results object that axe returns having the node property for every check result. This wasn't ideal and frankly not needed as the parent check object has the node in question.

So to get everything to work, I added the node to the object and then deleted it after we didn't need it any more. Is it a good solution? No. But I think it's probably the best we can do unless we want to refactor the entire function (which I would need some understanding first).

Allows us to work on #728 and #2330

Reviewer checks

Required fields, to be filled out by PR reviewer(s)

  • Follows the commit message policy, appropriate for next version
  • Code is reviewed for security

@straker straker requested a review from a team as a code owner October 28, 2020 20:49
@straker straker merged commit b188911 into develop Oct 29, 2020
@straker straker deleted the node-after branch October 29, 2020 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants