From 0bea428cc61c1a9a4da082471e6a6f985d649a14 Mon Sep 17 00:00:00 2001 From: Kat Date: Wed, 3 May 2023 16:30:32 +0100 Subject: [PATCH] Fix test validation messages --- spec/features/form/validations_spec.rb | 7 +++---- spec/fixtures/forms/2021_2022.json | 23 +++++++++++++++-------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb index 201059655..6c7afcfaa 100644 --- a/spec/features/form/validations_spec.rb +++ b/spec/features/form/validations_spec.rb @@ -147,9 +147,8 @@ RSpec.describe "validations" do it "prompts the user to confirm the value is correct with an interruption screen" do expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-value-check") - expect(page).to have_content("Net income is outside the expected range based on the lead tenant’s working situation") - expect(page).to have_content("You told us the lead tenant’s working situation is: full-time – 30 hours or more") - expect(page).to have_content("The household income you have entered is £750.00 every week") + expect(page).to have_content("You told us the lead tenant’s income is £750.00 weekly.") + expect(page).to have_content("This is higher than we would expect for their working situation.") click_button("Confirm and continue") expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-uc-proportion") end @@ -165,7 +164,7 @@ RSpec.describe "validations" do choose("lettings-log-incfreq-1-field", allow_label_click: true) click_button("Save and continue") expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-value-check") - expect(page).not_to have_content("Net income is outside the expected range based on the lead tenant’s working situation") + expect(page).not_to have_content("You told us the lead tenant’s income is £750.00 weekly.") expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success") end diff --git a/spec/fixtures/forms/2021_2022.json b/spec/fixtures/forms/2021_2022.json index b3ae2417e..42b0bb959 100644 --- a/spec/fixtures/forms/2021_2022.json +++ b/spec/fixtures/forms/2021_2022.json @@ -741,23 +741,30 @@ } ], "title_text": { - "translation": "soft_validations.net_income.title_text" - }, - "informative_text": { - "translation": "soft_validations.net_income.hint_text", + "translation": "soft_validations.net_income.title_text", "arguments": [ { - "key": "ecstat1", + "key": "incfreq", "label": true, - "i18n_template": "ecstat1" + "i18n_template": "incfreq" }, { - "key": "earnings", - "label": true, + "key": "field_formatted_as_currency", + "arguments_for_key": "earnings", "i18n_template": "earnings" } ] }, + "informative_text": { + "translation": "soft_validations.net_income.hint_text", + "arguments": [ + { + "key": "net_income_higher_or_lower_text", + "label": false, + "i18n_template": "net_income_higher_or_lower_text" + } + ] + }, "questions": { "net_income_value_check": { "check_answer_label": "Net income soft validation",