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

tests: check that every check has a message for every return type and messageKey #3181

Merged
merged 5 commits into from
Oct 5, 2021

Conversation

straker
Copy link
Contributor

@straker straker commented Oct 4, 2021

This will check that every time a checks unit test is run, it verifies that there exists a message for the return type, also taking into account how none checks use the opposite messages (e.g. a result of true will use a fail message). It will also verify that if the check has a data.messageKey property, that a specific message exists in the messages for that key.

Doing this revealed that we should combine the non-empty-if-present and non-empty-value checks as the fail state for what it's looking for (the state of the value attribute) produces a double message about the attribute:

"Fix any of the following:
  Element has a value attribute and the value attribute is empty
  Element has an empty value attribute
  ..."

Also made sure no pass result had a message key it didn't use in color-contrast (which seems to have run prettier on the file so that's why all the changes)

Closes issue: #3173

@straker straker requested a review from a team as a code owner October 4, 2021 16:15
@straker straker merged commit 6e714f4 into develop Oct 5, 2021
@straker straker deleted the test-message-exist branch October 5, 2021 14:51
straker added a commit that referenced this pull request Oct 18, 2021
… messageKey (#3181)

* tests: check that every check has a message for every return type and messageKey

* finalize

* fixes

* typo
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