Skip to content

Commit

Permalink
fix up tag tests and edit link
Browse files Browse the repository at this point in the history
  • Loading branch information
starswan committed Jan 16, 2025
1 parent 36beebc commit 5d66e32
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion app/components/job_application_review_component/section.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
40 changes: 20 additions & 20 deletions spec/system/jobseekers/jobseeker_applications_statuses_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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"))
Expand All @@ -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"))
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions spec/system/jobseekers/prefilling_applications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand All @@ -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"
Expand All @@ -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")
Expand All @@ -101,15 +101,15 @@
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")
expect(page).to have_content(previous_application.support_needed.capitalize)
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
Expand Down

0 comments on commit 5d66e32

Please sign in to comment.