Browse Source

Fix test validation messages

pull/1584/head
Kat 3 years ago
parent
commit
0bea428cc6
  1. 7
      spec/features/form/validations_spec.rb
  2. 23
      spec/fixtures/forms/2021_2022.json

7
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 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_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 income is £750.00 weekly.")
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("This is higher than we would expect for their working situation.")
expect(page).to have_content("The household income you have entered is £750.00 every week")
click_button("Confirm and continue") click_button("Confirm and continue")
expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-uc-proportion") expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-uc-proportion")
end end
@ -165,7 +164,7 @@ RSpec.describe "validations" do
choose("lettings-log-incfreq-1-field", allow_label_click: true) choose("lettings-log-incfreq-1-field", allow_label_click: true)
click_button("Save and continue") click_button("Save and continue")
expect(page).to have_current_path("/lettings-logs/#{lettings_log.id}/net-income-value-check") 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") expect(page).to have_css(".govuk-notification-banner.govuk-notification-banner--success")
end end

23
spec/fixtures/forms/2021_2022.json vendored

@ -741,23 +741,30 @@
} }
], ],
"title_text": { "title_text": {
"translation": "soft_validations.net_income.title_text" "translation": "soft_validations.net_income.title_text",
},
"informative_text": {
"translation": "soft_validations.net_income.hint_text",
"arguments": [ "arguments": [
{ {
"key": "ecstat1", "key": "incfreq",
"label": true, "label": true,
"i18n_template": "ecstat1" "i18n_template": "incfreq"
}, },
{ {
"key": "earnings", "key": "field_formatted_as_currency",
"label": true, "arguments_for_key": "earnings",
"i18n_template": "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": { "questions": {
"net_income_value_check": { "net_income_value_check": {
"check_answer_label": "Net income soft validation", "check_answer_label": "Net income soft validation",

Loading…
Cancel
Save