Skip to content

Commit

Permalink
Update default navigation and menu button labels (#464)
Browse files Browse the repository at this point in the history
These had fallen behind govuk-frontend, this change brings them back in
line. Thank you for spotting @lfdebrux!

Fixes #460
  • Loading branch information
peteryates authored Nov 16, 2023
2 parents 6993c50 + 663cdcb commit 25642f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/govuk/components/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def reset!
default_exit_this_page_timed_out_text: nil,
default_exit_this_page_press_two_more_times_text: nil,
default_exit_this_page_press_one_more_time_text: nil,
default_header_navigation_label: 'Navigation menu',
default_header_menu_button_label: 'Show or hide navigation menu',
default_header_navigation_label: 'Menu',
default_header_menu_button_label: 'Show or hide menu',
default_header_logotype: 'GOV.UK',
default_header_homepage_url: '/',
default_header_service_name: nil,
Expand Down
6 changes: 5 additions & 1 deletion spec/components/govuk_component/header_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@
expect(rendered_content).to have_tag('nav')
end

specify 'nav element contains default aria label' do
expect(rendered_content).to have_tag('nav', with: { 'aria-label' => 'Menu' })
end

specify 'nav contains the right number of items' do
expect(rendered_content).to have_tag("li", with: { class: "govuk-header__navigation-item" }, count: navigation_items.count)
end
Expand Down Expand Up @@ -292,7 +296,7 @@
describe 'menu button (for mobile)' do
let(:button_text) { 'Menu' }
let(:button_classes) { %w(govuk-header__menu-button govuk-js-header-toggle) }
let(:button_aria_label) { 'Show or hide navigation menu' }
let(:button_aria_label) { 'Show or hide menu' }

specify 'the button is rendered' do
expect(rendered_content).to have_tag('div', with: { class: 'govuk-header__content' }) do
Expand Down

0 comments on commit 25642f2

Please sign in to comment.