Browse Source

CLDC-1848 Update income hint text (#1236)

* Remove old income guidance text

* Add income hint text
pull/1218/head^2
kosiakkatrina 2 years ago committed by GitHub
parent
commit
4b43e5cb68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      app/models/form/sales/questions/buyer1_income.rb
  2. 2
      app/models/form/sales/questions/buyer1_income_known.rb
  3. 1
      app/models/form/sales/questions/buyer2_income.rb
  4. 2
      app/models/form/sales/questions/buyer2_income_known.rb
  5. 17
      app/views/form/guidance/_what_counts_as_income_sales.html.erb
  6. 9
      spec/models/form/sales/questions/buyer1_income_known_spec.rb
  7. 2
      spec/models/form/sales/questions/buyer1_income_spec.rb
  8. 9
      spec/models/form/sales/questions/buyer2_income_known_spec.rb
  9. 2
      spec/models/form/sales/questions/buyer2_income_spec.rb

1
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

2
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],
}

1
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

2
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],
}

17
app/views/form/guidance/_what_counts_as_income_sales.html.erb

@ -1,17 +0,0 @@
<%= govuk_details(summary_text: "What counts as income?") do %>
<p class="govuk-body">You should include any income from:</p>
<ul class="govuk-list govuk-list--bullet">
<li>employment</li>
<li>pensions</li>
<li>investments</li>
<li>Universal Credit</li>
</ul>
<p class="govuk-body">Don’t include:</p>
<ul class="govuk-list govuk-list--bullet">
<li>National Insurance (NI) contributions and tax</li>
<li>housing benefit</li>
<li>child benefit</li>
<li>council tax support</li>
</ul>
<% end %>

9
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

2
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

9
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

2
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

Loading…
Cancel
Save