From c91d8698bda9ae55025c6445ad543f09c6d40519 Mon Sep 17 00:00:00 2001 From: Corinne Durrmeyer Date: Mon, 21 Oct 2024 14:13:53 +0200 Subject: [PATCH] Remove useless note for screen readers --- .../champ_label_content_component.html.haml | 2 -- spec/system/users/brouillon_spec.rb | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml index ddbec2cf3..a6dc331f1 100644 --- a/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml +++ b/app/components/editable_champ/champ_label_content_component/champ_label_content_component.html.haml @@ -2,8 +2,6 @@ - if @champ.public? - if @champ.mandatory? = render EditableChamp::AsteriskMandatoryComponent.new - - else - %span.sr-only= t('.optional_champ') - if @champ.forked_with_changes? %span.updated-at.highlighted diff --git a/spec/system/users/brouillon_spec.rb b/spec/system/users/brouillon_spec.rb index ade916005..06eccfb32 100644 --- a/spec/system/users/brouillon_spec.rb +++ b/spec/system/users/brouillon_spec.rb @@ -442,7 +442,7 @@ describe 'The user', js: true do fill_individual - fill_in('age (facultatif)', with: 10) + fill_in('age', with: 10) click_on 'Déposer le dossier' expect(page).to have_current_path(merci_dossier_path(user_dossier)) end @@ -513,7 +513,7 @@ describe 'The user', js: true do fill_individual - fill_in('age (facultatif)', with: '18') + fill_in('age', with: '18') expect(page).to have_css('label', text: 'nom', visible: :visible) expect(page).to have_css('.icon.mandatory') click_on 'Déposer le dossier' @@ -550,7 +550,7 @@ describe 'The user', js: true do expect(page).to have_no_css('legend', text: 'info voiture', visible: true) expect(page).to have_no_css('label', text: 'tonnage', visible: true) - fill_in('age du candidat (facultatif)', with: '18') + fill_in('age du candidat', with: '18') expect(page).to have_css('legend', text: 'permis de conduire', visible: true) expect(page).to have_css('legend', text: 'info voiture', visible: true) expect(page).to have_no_css('label', text: 'tonnage', visible: true) @@ -563,10 +563,10 @@ describe 'The user', js: true do expect(page).to have_css('label', text: 'parking', visible: true) # try to fill with invalid data - fill_in('tonnage (facultatif)', with: 'a') + fill_in('tonnage', with: 'a') expect(page).to have_no_css('label', text: 'parking', visible: true) - fill_in('age du candidat (facultatif)', with: '2') + fill_in('age du candidat', with: '2') expect(page).to have_no_css('legend', text: 'permis de conduire', visible: true) expect(page).to have_no_css('label', text: 'tonnage', visible: true) @@ -578,7 +578,7 @@ describe 'The user', js: true do expect(page).to have_no_css('legend', text: 'permis de conduire', visible: true) expect(page).to have_no_css('label', text: 'tonnage', visible: true) - fill_in('age du candidat (facultatif)', with: '18') + fill_in('age du candidat', with: '18') wait_for_autosave # the champ keeps their previous value so they are all displayed