From b53c2a473f7262707f98ca095514b2026cf72197 Mon Sep 17 00:00:00 2001 From: MadeTech Dushan Date: Mon, 28 Feb 2022 15:04:28 +0000 Subject: [PATCH] validation spec changes --- spec/features/form/validations_spec.rb | 70 +++++++++++++------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb index fd09adefb..4073d9fa0 100644 --- a/spec/features/form/validations_spec.rb +++ b/spec/features/form/validations_spec.rb @@ -124,51 +124,51 @@ 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 on an interruption screen", js: true do + it "prompts the user to confirm the value is correct with an interruption screen" 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_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) + check("case-log-net-income-value-check-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 - 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) - click_button("Save and continue") - fill_in("case-log-earnings-field", with: income_under_soft_limit) - click_button("Save and continue") - expect(page).to have_current_path("/logs/#{case_log.id}/net-income-uc-proportion") - case_log.reload - expect(case_log.override_net_income_validation).to be_nil - end - - 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) - click_button("Save and continue") - fill_in("case-log-earnings-field", with: income_under_soft_limit) - click_button("Save and continue") - click_link(text: "Back") - expect(page).to have_no_content("Are you sure this is correct?") - end - - 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) - click_button("Save and continue") - check("case-log-override-net-income-validation-override-net-income-validation-field", allow_label_click: true) - click_button("Save and continue") - click_link(text: "Back") - expect(page).to have_content("Are you sure this is correct?") - end + # it "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) + # click_button("Save and continue") + # fill_in("case-log-earnings-field", with: income_under_soft_limit) + # click_button("Save and continue") + # expect(page).to have_current_path("/logs/#{case_log.id}/net-income-uc-proportion") + # case_log.reload + # expect(case_log.net_income_value_check).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 + # 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") + # fill_in("case-log-earnings-field", with: income_under_soft_limit) + # click_button("Save and continue") + # click_link(text: "Back") + # 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 + # 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") + # check("case-log-override-net-income-validation-override-net-income-validation-field", allow_label_click: true) + # click_button("Save and continue") + # click_link(text: "Back") + # expect(page).to have_content("Are you sure this is correct?") + # end end end