Skip to content

Commit

Permalink
Fix 'wcag/h71' violations
Browse files Browse the repository at this point in the history
Some of our examples have a fieldset with no legend, which violates this rule:

> <fieldset> must have a <legend> as the first child [wcag/h71]

Add a legend to all examples that use a fieldset and are currently missing a legend.
  • Loading branch information
36degrees committed Sep 5, 2022
1 parent 75ac45e commit 147e2a9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/govuk/components/all.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,7 @@ describe.each(allComponents)('%s', (component) => {
//
// Relax the rule to allow anything that is valid according to the
// spec.
'valid-id': ['error', { relaxed: true }],

'wcag/h71': 'off'
'valid-id': ['error', { relaxed: true }]
},
elements: [
'html5',
Expand Down
2 changes: 2 additions & 0 deletions src/govuk/components/checkboxes/checkboxes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -699,6 +699,8 @@ examples:
name: example-name
fieldset:
describedBy: some-id
legend:
text: Which option?
items:
- value: 1
text: Option 1
Expand Down
8 changes: 8 additions & 0 deletions src/govuk/components/fieldset/fieldset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ examples:
hidden: true
data:
describedBy: some-id
legend:
text: Which option?
- name: html as text
hidden: true
data:
Expand All @@ -134,12 +136,18 @@ examples:
hidden: true
data:
classes: app-fieldset--custom-modifier
legend:
text: Which option?
- name: role
hidden: true
data:
role: group
legend:
text: Which option?
- name: attributes
hidden: true
data:
attributes:
data-attribute: value
legend:
text: Which option?
2 changes: 2 additions & 0 deletions src/govuk/components/radios/radios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@ examples:
name: example-name
fieldset:
describedBy: some-id
legend:
text: Which option?
items:
- value: yes
text: Yes
Expand Down

0 comments on commit 147e2a9

Please sign in to comment.