Skip to content

Commit

Permalink
Fix: Apply landmark roles to content
Browse files Browse the repository at this point in the history
Accessibility: All page content should be contained by landmarks
Reference: alphagov/govuk-frontend#1604

- re-enabled the AXE rule `region`
- apply role attribute to phase banner and navigation, language switcher grids
  • Loading branch information
naseberry committed Oct 12, 2023
1 parent c65d6f8 commit 5457576
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@
tag: { text: t(".header.phase") },
text: t(".header.phase_banner_html", link: govuk_link_to(t(".header.feedback"), new_feedback_path)),
classes: "no-print",
html_attributes: { role: "complementary" },
) %>

<div class="govuk-grid-row">
<div class="govuk-grid-row" role="navigation">
<div class="govuk-grid-column-one-half show-empty">
<%= content_for(:navigation) %>
</div>
Expand Down
4 changes: 2 additions & 2 deletions features/step_definitions/civil_journey_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -898,13 +898,13 @@
end

Given("I click Check Your Answers Change link for vehicle {string}") do |vehicle|
steps %(Then the page should be axe clean skipping: region, aria-allowed-attr) if run_axe?
steps %(Then the page should be axe clean skipping: aria-allowed-attr) if run_axe?

find_link("Vehicle #{vehicle}", visible: false).click
end

Given("I click Check Your Answers Change link for proceeding {string}") do |question|
steps %(Then the page should be axe clean skipping: region, aria-allowed-attr) if run_axe?
steps %(Then the page should be axe clean skipping: aria-allowed-attr) if run_axe?
question_id = question.parameterize(separator: "_")

within "#app-check-your-answers__proceeding_#{question_id}" do
Expand Down
2 changes: 1 addition & 1 deletion features/support/steps_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
end

Then("I click {string}") do |button_name|
steps %(Then the page should be axe clean skipping: region, aria-allowed-attr) if run_axe?
steps %(Then the page should be axe clean skipping: aria-allowed-attr) if run_axe?
click_button(button_name)
end

Expand Down

0 comments on commit 5457576

Please sign in to comment.