From 42e01d77099331128a4b069bf4ef4e3e8b0a8488 Mon Sep 17 00:00:00 2001 From: MadeTech Dushan Date: Thu, 10 Feb 2022 16:21:23 +0000 Subject: [PATCH] Set up failing test for new soft validation design --- spec/features/form/validations_spec.rb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb index c08a8cf39..fd09adefb 100644 --- a/spec/features/form/validations_spec.rb +++ b/spec/features/form/validations_spec.rb @@ -124,18 +124,19 @@ RSpec.describe "validations" do let(:income_over_soft_limit) { 750 } let(:income_under_soft_limit) { 700 } - it "prompts the user to confirm the value is correct", js: true do + it "prompts the user to confirm the value is correct on an interruption screen", js: true do visit("/logs/#{case_log.id}/net-income") fill_in("case-log-earnings-field", with: income_over_soft_limit) choose("case-log-incfreq-0-field", allow_label_click: true) click_button("Save and continue") - expect(page).to have_content("Are you sure this is correct?") - check("case-log-override-net-income-validation-override-net-income-validation-field", allow_label_click: true) + expect(page).to have_current_path("/logs/#{case_log.id}/net-income-value-check") + expect(page).to have_content("Is the value correct?") + check("case-log-net-income-soft-validation-yes-field", allow_label_click: true) click_button("Save and continue") expect(page).to have_current_path("/logs/#{case_log.id}/net-income-uc-proportion") end - it "does not require confirming the value if the value is amended" do + xit "does not require confirming the value if the value is amended" do visit("/logs/#{case_log.id}/net-income") fill_in("case-log-earnings-field", with: income_over_soft_limit) choose("case-log-incfreq-0-field", allow_label_click: true) @@ -147,7 +148,7 @@ RSpec.describe "validations" do expect(case_log.override_net_income_validation).to be_nil end - it "clears the confirmation question if the amount was amended and the page is returned to using the back button", js: true do + xit "clears the confirmation question if the amount was amended and the page is returned to using the back button", js: true do visit("/logs/#{case_log.id}/net-income") fill_in("case-log-earnings-field", with: income_over_soft_limit) choose("case-log-incfreq-0-field", allow_label_click: true) @@ -158,7 +159,7 @@ RSpec.describe "validations" do expect(page).to have_no_content("Are you sure this is correct?") end - it "does not clear the confirmation question if the page is returned to using the back button and the amount is still over the soft limit", js: true do + xit "does not clear the confirmation question if the page is returned to using the back button and the amount is still over the soft limit", js: true do visit("/logs/#{case_log.id}/net-income") fill_in("case-log-earnings-field", with: income_over_soft_limit) choose("case-log-incfreq-0-field", allow_label_click: true)