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

govuk checkboxes component has invalid value set for test #2834

Closed
kyle-bowden opened this issue Sep 9, 2022 · 1 comment
Closed

govuk checkboxes component has invalid value set for test #2834

kyle-bowden opened this issue Sep 9, 2022 · 1 comment
Labels
awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation)

Comments

@kyle-bowden
Copy link

kyle-bowden commented Sep 9, 2022

Description of the issue

We have recently revised some of our patched tests in play-frontend-hmrc which integrate with govuk components. We have found an example that is missing a flag. The HTML example specifies that the red item has a checked attribute but the first item for the checkbox should also then be marked as "checked": true here.

UPDATE

I found a few more examples that require the "checked": true property on the relevant item.

Environment (where applicable)

  • GOV.UK Frontend Version: v4.3.1
@kyle-bowden kyle-bowden added awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) labels Sep 9, 2022
@owenatgov
Copy link
Contributor

Hi @kyle-bowden. Thanks for raising this issue, however this behaviour is intentional.

These examples are intended to test the values attribute, which is an option at the root of the macro call that allows teams to set the checkbox values as a single array instead of using checked. You can read about it and how it interacts with the checked value on individual items in the nunjucks macro guidance. This feature was introduced in #2616

To illustrate this with the initial example, this scenario is codified in the yml file containing the checkbox API docs and is used in the associated test. The intended behaviour here is that we can pass what is checked in the checkbox array via values, in this case red and green, but the intended behaviour is that the value of checked, if specified, overrides values.

With the above in mind, I'm going to close this issue. We hope you will consider contributing again in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting triage Needs triaging by team 🐛 bug Something isn't working the way it should (including incorrect wording in documentation)
Projects
None yet
Development

No branches or pull requests

2 participants