From 4b43e5cb68944a5a0b3a468aaadea0ec5858523a Mon Sep 17 00:00:00 2001 From: kosiakkatrina <54268893+kosiakkatrina@users.noreply.github.com> Date: Thu, 26 Jan 2023 12:04:57 +0000 Subject: [PATCH] CLDC-1848 Update income hint text (#1236) * Remove old income guidance text * Add income hint text --- .../form/sales/questions/buyer1_income.rb | 1 + .../form/sales/questions/buyer1_income_known.rb | 2 -- .../form/sales/questions/buyer2_income.rb | 1 + .../form/sales/questions/buyer2_income_known.rb | 2 -- .../_what_counts_as_income_sales.html.erb | 17 ----------------- .../sales/questions/buyer1_income_known_spec.rb | 9 --------- .../form/sales/questions/buyer1_income_spec.rb | 2 +- .../sales/questions/buyer2_income_known_spec.rb | 9 --------- .../form/sales/questions/buyer2_income_spec.rb | 2 +- 9 files changed, 4 insertions(+), 41 deletions(-) delete mode 100644 app/views/form/guidance/_what_counts_as_income_sales.html.erb diff --git a/app/models/form/sales/questions/buyer1_income.rb b/app/models/form/sales/questions/buyer1_income.rb index 4a7e43e55..43451af50 100644 --- a/app/models/form/sales/questions/buyer1_income.rb +++ b/app/models/form/sales/questions/buyer1_income.rb @@ -4,6 +4,7 @@ class Form::Sales::Questions::Buyer1Income < ::Form::Question @id = "income1" @check_answer_label = "Buyer 1’s gross annual income" @header = "Buyer 1’s gross annual income" + @hint_text = "Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments." @type = "numeric" @min = 0 @max = 999_999 diff --git a/app/models/form/sales/questions/buyer1_income_known.rb b/app/models/form/sales/questions/buyer1_income_known.rb index 36b5ec3f4..64462fa59 100644 --- a/app/models/form/sales/questions/buyer1_income_known.rb +++ b/app/models/form/sales/questions/buyer1_income_known.rb @@ -6,8 +6,6 @@ class Form::Sales::Questions::Buyer1IncomeKnown < ::Form::Question @header = "Do you know buyer 1’s annual income?" @type = "radio" @answer_options = ANSWER_OPTIONS - @guidance_position = GuidancePosition::BOTTOM - @guidance_partial = "what_counts_as_income_sales" @conditional_for = { "income1" => [0], } diff --git a/app/models/form/sales/questions/buyer2_income.rb b/app/models/form/sales/questions/buyer2_income.rb index 2bda83544..680bf8ae7 100644 --- a/app/models/form/sales/questions/buyer2_income.rb +++ b/app/models/form/sales/questions/buyer2_income.rb @@ -5,6 +5,7 @@ class Form::Sales::Questions::Buyer2Income < ::Form::Question @check_answer_label = "Buyer 2’s gross annual income" @header = "Buyer 2’s gross annual income" @type = "numeric" + @hint_text = "Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments." @min = 0 @step = 1 @width = 5 diff --git a/app/models/form/sales/questions/buyer2_income_known.rb b/app/models/form/sales/questions/buyer2_income_known.rb index 385bd9562..0b4613809 100644 --- a/app/models/form/sales/questions/buyer2_income_known.rb +++ b/app/models/form/sales/questions/buyer2_income_known.rb @@ -6,8 +6,6 @@ class Form::Sales::Questions::Buyer2IncomeKnown < ::Form::Question @header = "Do you know buyer 2’s annual income?" @type = "radio" @answer_options = ANSWER_OPTIONS - @guidance_position = GuidancePosition::BOTTOM - @guidance_partial = "what_counts_as_income_sales" @conditional_for = { "income2" => [0], } diff --git a/app/views/form/guidance/_what_counts_as_income_sales.html.erb b/app/views/form/guidance/_what_counts_as_income_sales.html.erb deleted file mode 100644 index c5e2c7116..000000000 --- a/app/views/form/guidance/_what_counts_as_income_sales.html.erb +++ /dev/null @@ -1,17 +0,0 @@ -<%= govuk_details(summary_text: "What counts as income?") do %> -

You should include any income from:

- - -

Don’t include:

- -<% end %> diff --git a/spec/models/form/sales/questions/buyer1_income_known_spec.rb b/spec/models/form/sales/questions/buyer1_income_known_spec.rb index a9d3ed9c8..aafe16c2d 100644 --- a/spec/models/form/sales/questions/buyer1_income_known_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_known_spec.rb @@ -44,15 +44,6 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeKnown, type: :model do }) end - it "has the correct guidance_partial" do - expect(question.guidance_partial).to eq("what_counts_as_income_sales") - end - - it "has the correct guidance position", :aggregate_failures do - expect(question.bottom_guidance?).to eq(true) - expect(question.top_guidance?).to eq(false) - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(1) end diff --git a/spec/models/form/sales/questions/buyer1_income_spec.rb b/spec/models/form/sales/questions/buyer1_income_spec.rb index 978e2d0bb..8482f0558 100644 --- a/spec/models/form/sales/questions/buyer1_income_spec.rb +++ b/spec/models/form/sales/questions/buyer1_income_spec.rb @@ -32,7 +32,7 @@ RSpec.describe Form::Sales::Questions::Buyer1Income, type: :model do end it "has the correct hint" do - expect(question.hint_text).to be_nil + expect(question.hint_text).to eq("Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments.") end it "has correct width" do diff --git a/spec/models/form/sales/questions/buyer2_income_known_spec.rb b/spec/models/form/sales/questions/buyer2_income_known_spec.rb index ead045245..a1be51ad4 100644 --- a/spec/models/form/sales/questions/buyer2_income_known_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_known_spec.rb @@ -44,15 +44,6 @@ RSpec.describe Form::Sales::Questions::Buyer2IncomeKnown, type: :model do }) end - it "has the correct guidance_partial" do - expect(question.guidance_partial).to eq("what_counts_as_income_sales") - end - - it "has the correct guidance position", :aggregate_failures do - expect(question.bottom_guidance?).to eq(true) - expect(question.top_guidance?).to eq(false) - end - it "has the correct check_answers_card_number" do expect(question.check_answers_card_number).to eq(2) end diff --git a/spec/models/form/sales/questions/buyer2_income_spec.rb b/spec/models/form/sales/questions/buyer2_income_spec.rb index baf97a2f5..2a863f7cb 100644 --- a/spec/models/form/sales/questions/buyer2_income_spec.rb +++ b/spec/models/form/sales/questions/buyer2_income_spec.rb @@ -32,7 +32,7 @@ RSpec.describe Form::Sales::Questions::Buyer2Income, type: :model do end it "has the correct hint" do - expect(question.hint_text).to be_nil + expect(question.hint_text).to eq("Provide the gross annual income (i.e. salary before tax) plus the annual amount of benefits, Universal Credit or pensions, and income from investments.") end it "has correct width" do