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

Fixes issue when violations count is reported to be 0 #272

Merged
merged 2 commits into from
Jul 1, 2021

Conversation

scalvert
Copy link
Contributor

@scalvert scalvert commented Jul 1, 2021

It's possible when encountering violations that the violations' node array is empty. In that case, when we try to format the violation, we output a 0 count for violations due to the fact we try to infer the violations count occurrences through the presence of node's html.

In addition, the formatViolation tests were not indicative of the actual execution of this function. The function signature indicated that both violation and markup could be either undefined or optional respectively, but this did not reflect how this was used in practice. The two parameters are always required, and this misalignment helped manifest this bug.

This PR addresses both fixing the issue, and updating the tests to better reflect the usage.

Copy link

@ckundo ckundo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, please update the docs and 🚀

addon-test-support/format-violation.ts Outdated Show resolved Hide resolved
addon-test-support/format-violation.ts Show resolved Hide resolved
Copy link
Contributor

@drewlee drewlee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@scalvert scalvert merged commit 162cf0c into master Jul 1, 2021
@drewlee drewlee deleted the fix-zero-count branch December 3, 2022 01:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants