diff --git a/app/components/job_application_review_component/section.rb b/app/components/job_application_review_component/section.rb index c3678acd2f..11f7ea1d01 100644 --- a/app/components/job_application_review_component/section.rb +++ b/app/components/job_application_review_component/section.rb @@ -26,7 +26,7 @@ def edit_link title = heading_text text = "Change" href = error_path - govuk_link_to text, href, aria: { label: "#{text} #{title}" }, classes: "govuk-!-display-none-print" if href + govuk_link_to text, href, aria: { label: "#{text} #{title}" }, classes: "govuk-!-display-none-print" if href && allow_edit? end def constantize_form(form_class_name) diff --git a/spec/system/jobseekers/jobseeker_applications_statuses_spec.rb b/spec/system/jobseekers/jobseeker_applications_statuses_spec.rb index 8fe9bc1c76..012f037611 100644 --- a/spec/system/jobseekers/jobseeker_applications_statuses_spec.rb +++ b/spec/system/jobseekers/jobseeker_applications_statuses_spec.rb @@ -23,11 +23,11 @@ click_button "Start application" - expect(page).to have_css("#personal_details", text: "in progress") - expect(page).to have_css("#professional_status", text: "in progress") - expect(page).to have_css("#qualifications", text: "in progress") - expect(page).to have_css("#training_and_cpds", text: "in progress") - expect(page).to have_css("#employment_history", text: "in progress") + expect(page).to have_css("#personal_details", text: I18n.t("shared.status_tags.in_progress")) + expect(page).to have_css("#professional_status", text: I18n.t("shared.status_tags.in_progress")) + expect(page).to have_css("#qualifications", text: I18n.t("shared.status_tags.in_progress")) + expect(page).to have_css("#training_and_cpds", text: I18n.t("shared.status_tags.in_progress")) + expect(page).to have_css("#employment_history", text: I18n.t("shared.status_tags.in_progress")) end end @@ -42,11 +42,11 @@ click_button "Start application" - expect(page).to have_css("#personal_details", text: "not started") - expect(page).to have_css("#professional_status", text: "not started") - expect(page).to have_css("#qualifications", text: "not started") - expect(page).to have_css("#training_and_cpds", text: "not started") - expect(page).to have_css("#employment_history", text: "not started") + expect(page).to have_css("#personal_details", text: I18n.t("shared.status_tags.not_started")) + expect(page).to have_css("#professional_status", text: I18n.t("shared.status_tags.not_started")) + expect(page).to have_css("#qualifications", text: I18n.t("shared.status_tags.not_started")) + expect(page).to have_css("#training_and_cpds", text: I18n.t("shared.status_tags.not_started")) + expect(page).to have_css("#employment_history", text: I18n.t("shared.status_tags.not_started")) end end @@ -61,11 +61,11 @@ click_button "Start application" - expect(page).to have_css("#personal_details", text: "not started") - expect(page).to have_css("#professional_status", text: "not started") - expect(page).to have_css("#qualifications", text: "in progress") - expect(page).to have_css("#training_and_cpds", text: "not started") - expect(page).to have_css("#employment_history", text: "in progress") + expect(page).to have_css("#personal_details", text: I18n.t("shared.status_tags.not_started")) + expect(page).to have_css("#professional_status", text: I18n.t("shared.status_tags.not_started")) + expect(page).to have_css("#qualifications", text: I18n.t("shared.status_tags.in_progress")) + expect(page).to have_css("#training_and_cpds", text: I18n.t("shared.status_tags.not_started")) + expect(page).to have_css("#employment_history", text: I18n.t("shared.status_tags.in_progress")) end context "when the jobseeker completes a section" do @@ -84,7 +84,7 @@ fill_in_personal_details click_on "Save and continue" - expect(page).to have_css("#personal_details", text: "complete") + expect(page).to have_css("#personal_details", text: I18n.t("shared.status_tags.complete")) within("#professional_status") do click_link("Professional status") @@ -93,7 +93,7 @@ fill_in_professional_status click_on "Save and continue" - expect(page).to have_css("#professional_status", text: "complete") + expect(page).to have_css("#professional_status", text: I18n.t("shared.status_tags.complete")) within("#qualifications") do click_link("Qualifications") @@ -102,7 +102,7 @@ choose "Yes, I've completed this section" click_on "Save and continue" - expect(page).to have_css("#qualifications", text: "complete") + expect(page).to have_css("#qualifications", text: I18n.t("shared.status_tags.complete")) within("#training_and_cpds") do click_link(I18n.t("jobseekers.job_applications.build.training_and_cpds.heading")) @@ -111,7 +111,7 @@ choose "Yes, I've completed this section" click_on "Save and continue" - expect(page).to have_css("#training_and_cpds", text: "complete") + expect(page).to have_css("#training_and_cpds", text: I18n.t("shared.status_tags.complete")) within("#employment_history") do click_link(I18n.t("jobseekers.job_applications.build.employment_history.heading")) @@ -124,7 +124,7 @@ choose "Yes, I've completed this section" click_on "Save and continue" - expect(page).to have_css("#employment_history", text: "complete") + expect(page).to have_css("#employment_history", text: I18n.t("shared.status_tags.complete")) end end end diff --git a/spec/system/jobseekers/prefilling_applications_spec.rb b/spec/system/jobseekers/prefilling_applications_spec.rb index daaafb6085..c6bb271a86 100644 --- a/spec/system/jobseekers/prefilling_applications_spec.rb +++ b/spec/system/jobseekers/prefilling_applications_spec.rb @@ -43,14 +43,14 @@ expect(current_job_application.last_name).to eq(previous_application.last_name) expect(current_job_application.phone_number).to eq(previous_application.phone_number) within("#personal_details") do - expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: "imported") + expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: I18n.t("shared.status_tags.imported")) end click_on "Personal statement" expect(page).to have_content(previous_application.personal_statement) click_on "Back" within("#personal_statement") do - expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: "imported") + expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: I18n.t("shared.status_tags.imported")) end # qualified teacher status @@ -60,7 +60,7 @@ expect(current_job_application.right_to_work_in_uk).to eq("yes") within("#professional_status") do - expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: "imported") + expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: I18n.t("shared.status_tags.imported")) end # references click_on "References" @@ -76,7 +76,7 @@ expect(page).to have_content(employment2.organisation) click_on "Back" within("#employment_history") do - expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: "imported") + expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: I18n.t("shared.status_tags.imported")) end click_on "Qualifications" @@ -90,7 +90,7 @@ click_on "Back" within("#qualifications") do - expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: "imported") + expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: I18n.t("shared.status_tags.imported")) end click_on I18n.t("jobseekers.job_applications.build.training_and_cpds.heading") @@ -101,7 +101,7 @@ click_on "Back" within("#training_and_cpds") do - expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: "imported") + expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: I18n.t("shared.status_tags.imported")) end click_on I18n.t("jobseekers.job_applications.build.ask_for_support.heading") @@ -109,7 +109,7 @@ expect(page).to have_content(previous_application.support_needed_details) click_on "Back" within("#ask_for_support") do - expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: "imported") + expect(page).to have_css("strong.govuk-tag.govuk-tag--blue", text: I18n.t("shared.status_tags.imported")) end end end