diff --git a/app/components/main_navigation/instructeur_expert_navigation_component.rb b/app/components/main_navigation/instructeur_expert_navigation_component.rb index 8e8cddd41..f12d23c1f 100644 --- a/app/components/main_navigation/instructeur_expert_navigation_component.rb +++ b/app/components/main_navigation/instructeur_expert_navigation_component.rb @@ -10,7 +10,7 @@ class MainNavigation::InstructeurExpertNavigationComponent < ApplicationComponen end def aria_current_for(page) - { current: page == current_page ? :page : nil } + { current: page == current_page ? true : nil } end private diff --git a/app/views/administrateurs/_main_navigation.html.haml b/app/views/administrateurs/_main_navigation.html.haml index a1336604f..4c6010d04 100644 --- a/app/views/administrateurs/_main_navigation.html.haml +++ b/app/views/administrateurs/_main_navigation.html.haml @@ -1,6 +1,6 @@ %nav#header-navigation.fr-nav{ role: 'navigation', 'aria-label': 'Menu principal administrateur' } %ul.fr-nav__list - %li.fr-nav__item= link_to 'Mes démarches', admin_procedures_path, class:'fr-nav__link', 'aria-current': current_page?(controller: 'administrateurs/procedures', action: :index) ? 'page' : nil + %li.fr-nav__item= link_to 'Mes démarches', admin_procedures_path, class:'fr-nav__link', 'aria-current': current_page?(controller: 'administrateurs/procedures', action: :index) ? 'true' : nil - if Rails.application.config.ds_zonage_enabled %li.fr-nav__item= link_to 'Toutes les démarches', all_admin_procedures_path(zone_ids: :admin_default), class:'fr-nav__link', 'aria-current': current_page?(all_admin_procedures_path) ? 'page' : nil - if current_administrateur.groupe_gestionnaire_id diff --git a/app/views/users/_main_navigation.html.haml b/app/views/users/_main_navigation.html.haml index 602dfec9f..4d10e5a49 100644 --- a/app/views/users/_main_navigation.html.haml +++ b/app/views/users/_main_navigation.html.haml @@ -5,4 +5,4 @@ = link_to t('back', scope: [:layouts, :header]), url_for(:back), title: t('back_title', scope: [:layouts, :header]), class: 'fr-nav__link', "aria-controls" => "modal-header__menu" %li.fr-nav__item - = link_to t('files', scope: [:layouts, :header]), dossiers_path, class: 'fr-nav__link', aria: { current: current_page?(dossiers_path) ? 'page' : nil, controls: "modal-header__menu" } + = link_to t('files', scope: [:layouts, :header]), dossiers_path, class: 'fr-nav__link', aria: { current: controller_name == 'dossiers' ? 'true' : nil, controls: "modal-header__menu" } diff --git a/spec/components/main_navigation/instructeur_expert_navigation_component_spec.rb b/spec/components/main_navigation/instructeur_expert_navigation_component_spec.rb index 35f698c61..73dfe3cd6 100644 --- a/spec/components/main_navigation/instructeur_expert_navigation_component_spec.rb +++ b/spec/components/main_navigation/instructeur_expert_navigation_component_spec.rb @@ -24,7 +24,7 @@ describe MainNavigation::InstructeurExpertNavigationComponent, type: :component describe 'when instructor is signed in' do it 'renders a link to instructeur procedures with current page class' do expect(subject).to have_link('Démarches', href: component.helpers.instructeur_procedures_path) - expect(subject).to have_selector('a[aria-current="page"]', text: 'Démarches') + expect(subject).to have_selector('a[aria-current="true"]', text: 'Démarches') end it 'does not have Avis' do @@ -39,7 +39,7 @@ describe MainNavigation::InstructeurExpertNavigationComponent, type: :component it 'render have Avis link' do expect(subject).to have_link('Avis', href: component.helpers.expert_all_avis_path) - expect(subject).not_to have_selector('a[aria-current="page"]', text: 'Avis') + expect(subject).not_to have_selector('a[aria-current="true"]', text: 'Avis') end end @@ -65,7 +65,7 @@ describe MainNavigation::InstructeurExpertNavigationComponent, type: :component it 'renders a link to expert all avis with current page class' do expect(subject).to have_link('Avis', href: component.helpers.expert_all_avis_path) - expect(subject).to have_selector('a[aria-current="page"]', text: 'Avis') + expect(subject).to have_selector('a[aria-current="true"]', text: 'Avis') expect(subject).not_to have_selector('span.badge') end @@ -86,7 +86,7 @@ describe MainNavigation::InstructeurExpertNavigationComponent, type: :component it 'render have Démarches link' do expect(subject).to have_link('Démarches', href: component.helpers.instructeur_procedures_path) - expect(subject).not_to have_selector('a[aria-current="page"]', text: 'Démarches') + expect(subject).not_to have_selector('a[aria-current="true"]', text: 'Démarches') end end end