Browse Source

Set up failing test for new soft validation design

pull/372/head
MadeTech Dushan 3 years ago committed by baarkerlounger
parent
commit
d548b6d7ef
  1. 13
      spec/features/form/validations_spec.rb

13
spec/features/form/validations_spec.rb

@ -124,18 +124,19 @@ RSpec.describe "validations" do
let(:income_over_soft_limit) { 750 } let(:income_over_soft_limit) { 750 }
let(:income_under_soft_limit) { 700 } 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") visit("/logs/#{case_log.id}/net-income")
fill_in("case-log-earnings-field", with: income_over_soft_limit) fill_in("case-log-earnings-field", with: income_over_soft_limit)
choose("case-log-incfreq-0-field", allow_label_click: true) choose("case-log-incfreq-0-field", allow_label_click: true)
click_button("Save and continue") click_button("Save and continue")
expect(page).to have_content("Are you sure this is correct?") expect(page).to have_current_path("/logs/#{case_log.id}/net-income-value-check")
check("case-log-override-net-income-validation-override-net-income-validation-field", allow_label_click: true) 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") click_button("Save and continue")
expect(page).to have_current_path("/logs/#{case_log.id}/net-income-uc-proportion") expect(page).to have_current_path("/logs/#{case_log.id}/net-income-uc-proportion")
end 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") visit("/logs/#{case_log.id}/net-income")
fill_in("case-log-earnings-field", with: income_over_soft_limit) fill_in("case-log-earnings-field", with: income_over_soft_limit)
choose("case-log-incfreq-0-field", allow_label_click: true) 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 expect(case_log.override_net_income_validation).to be_nil
end 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") visit("/logs/#{case_log.id}/net-income")
fill_in("case-log-earnings-field", with: income_over_soft_limit) fill_in("case-log-earnings-field", with: income_over_soft_limit)
choose("case-log-incfreq-0-field", allow_label_click: true) 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?") expect(page).to have_no_content("Are you sure this is correct?")
end 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") visit("/logs/#{case_log.id}/net-income")
fill_in("case-log-earnings-field", with: income_over_soft_limit) fill_in("case-log-earnings-field", with: income_over_soft_limit)
choose("case-log-incfreq-0-field", allow_label_click: true) choose("case-log-incfreq-0-field", allow_label_click: true)

Loading…
Cancel
Save