From 663cdcb617ace230f3cb6789492fdff865a934ab Mon Sep 17 00:00:00 2001 From: Peter Yates Date: Thu, 16 Nov 2023 00:14:52 +0000 Subject: [PATCH] Update default navigation and menu button labels These had fallen behind govuk-frontend, this change brings them back in line. Thank you for spotting @lfdebrux! Fixes #460 --- lib/govuk/components/engine.rb | 4 ++-- spec/components/govuk_component/header_component_spec.rb | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/govuk/components/engine.rb b/lib/govuk/components/engine.rb index 6926a852..a16744b5 100644 --- a/lib/govuk/components/engine.rb +++ b/lib/govuk/components/engine.rb @@ -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, diff --git a/spec/components/govuk_component/header_component_spec.rb b/spec/components/govuk_component/header_component_spec.rb index 0ac855ad..906957cd 100644 --- a/spec/components/govuk_component/header_component_spec.rb +++ b/spec/components/govuk_component/header_component_spec.rb @@ -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 @@ -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