This PR can be summarized in the following changelog entry:
[@yoast/schema-blocks] Refactors the BlockValidation enum to group valid, okay and invalid results into three categories.
Relevant technical choices:
This is a change proposed by @herregroen. The motivation is that it will be easier to write logic based on the three categories of 'validness'.
I created a new enum value OK, for those validation results that should result in an orange bullet (for reasons other than being a missing recommended block, which has its own value in the enum).
I simplified the isValidResult function to just check whether the result is < 300 (because all invalid results are 300+). A change from the previous version of the code is that the Skipped result now is considered valid too, whereas previously it was invalid (because it was absent in isValidResult). I think this is not a problem, because we should not see this result anyway.
Do a smoke test on the sidebar analysis; do you see the bullets you expect when making changes (for example, adding/removing required and recommended blocks, having an empty required block, having a job title that equals the post title)?
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
*
UI changes
[ ] This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.
Quality assurance
[x] I have tested this code to the best of my abilities
[ ] I have added unittests to verify the code works as intended
Summary
This PR can be summarized in the following changelog entry:
BlockValidation
enum to group valid, okay and invalid results into three categories.Relevant technical choices:
OK
, for those validation results that should result in an orange bullet (for reasons other than being a missing recommended block, which has its own value in the enum).isValidResult
function to just check whether the result is< 300
(because all invalid results are 300+). A change from the previous version of the code is that theSkipped
result now is considered valid too, whereas previously it was invalid (because it was absent inisValidResult
). I think this is not a problem, because we should not see this result anyway.Test instructions
This PR can be tested by following these steps:
Impact check
UI changes
Quality assurance
Fixes #