Browse Source

CLDC-4307: Move buyer income hint text to income known qs (#3291)

* CLDC-4307: move buyer income hint text up a level

* CLDC-4307: update tests

* CLDC-4307: reformat tests
pull/3297/merge
Nat Dean-Lewis 2 days ago committed by GitHub
parent
commit
15f6e2a919
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      config/locales/forms/2025/sales/income_benefits_and_savings.en.yml
  2. 8
      config/locales/forms/2026/sales/income_benefits_and_savings.en.yml
  3. 14
      spec/models/form/sales/questions/buyer1_income_known_spec.rb
  4. 14
      spec/models/form/sales/questions/buyer1_income_spec.rb

8
config/locales/forms/2025/sales/income_benefits_and_savings.en.yml

@ -8,12 +8,12 @@ en:
income1nk:
check_answer_label: "Buyer 1’s gross annual income known"
check_answer_prompt: "Enter buyer 1’s gross annual income if known"
hint_text: ""
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."
question_text: "Do you know buyer 1’s annual income?"
income1:
check_answer_label: "Buyer 1’s gross annual income"
check_answer_prompt: ""
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."
hint_text: ""
question_text: "Buyer 1’s gross annual income"
inc1mort:
@ -28,12 +28,12 @@ en:
income2nk:
check_answer_label: "Buyer 2’s gross annual income known"
check_answer_prompt: "Enter buyer 2’s gross annual income if known"
hint_text: ""
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."
question_text: "Do you know buyer 2’s annual income?"
income2:
check_answer_label: "Buyer 2’s gross annual income"
check_answer_prompt: ""
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."
hint_text: ""
question_text: "Buyer 2’s gross annual income"
inc2mort:

8
config/locales/forms/2026/sales/income_benefits_and_savings.en.yml

@ -8,12 +8,12 @@ en:
income1nk:
check_answer_label: "Buyer 1’s gross annual income known"
check_answer_prompt: "Enter buyer 1’s gross annual income if known"
hint_text: ""
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."
question_text: "Do you know buyer 1’s annual income?"
income1:
check_answer_label: "Buyer 1’s gross annual income"
check_answer_prompt: ""
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."
hint_text: ""
question_text: "Buyer 1’s gross annual income"
inc1mort:
@ -28,12 +28,12 @@ en:
income2nk:
check_answer_label: "Buyer 2’s gross annual income known"
check_answer_prompt: "Enter buyer 2’s gross annual income if known"
hint_text: ""
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."
question_text: "Do you know buyer 2’s annual income?"
income2:
check_answer_label: "Buyer 2’s gross annual income"
check_answer_prompt: ""
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."
hint_text: ""
question_text: "Buyer 2’s gross annual income"
inc2mort:

14
spec/models/form/sales/questions/buyer1_income_known_spec.rb

@ -1,11 +1,19 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::Buyer1IncomeKnown, type: :model do
include CollectionTimeHelper
subject(:question) { described_class.new(question_id, question_definition, page) }
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) }
let(:page) { instance_double(Form::Page) }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: current_collection_start_date) }
before do
allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form)
end
it "has correct page" do
expect(question.page).to eq(page)
@ -39,4 +47,8 @@ RSpec.describe Form::Sales::Questions::Buyer1IncomeKnown, type: :model do
it "has the correct check_answers_card_number" do
expect(question.check_answers_card_number).to eq(1)
end
it "has the correct hint_text" do
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
end

14
spec/models/form/sales/questions/buyer1_income_spec.rb

@ -1,11 +1,19 @@
require "rails_helper"
RSpec.describe Form::Sales::Questions::Buyer1Income, type: :model do
include CollectionTimeHelper
subject(:question) { described_class.new(question_id, question_definition, page) }
let(:question_id) { nil }
let(:question_definition) { nil }
let(:page) { instance_double(Form::Page, subsection: instance_double(Form::Subsection, form: instance_double(Form, start_date: Time.zone.local(2023, 4, 1)))) }
let(:page) { instance_double(Form::Page) }
let(:subsection) { instance_double(Form::Subsection) }
let(:form) { instance_double(Form, start_date: current_collection_start_date) }
before do
allow(page).to receive(:subsection).and_return(subsection)
allow(subsection).to receive(:form).and_return(form)
end
it "has correct page" do
expect(question.page).to eq(page)
@ -46,4 +54,8 @@ RSpec.describe Form::Sales::Questions::Buyer1Income, type: :model do
it "has correct max" do
expect(question.max).to eq(999_999)
end
it "has the correct hint_text" do
expect(question.hint_text).to eq("")
end
end

Loading…
Cancel
Save