diff --git a/app/models/form/sales/questions/previous_postcode_known.rb b/app/models/form/sales/questions/previous_postcode_known.rb index 25ee906f8..9806d12e4 100644 --- a/app/models/form/sales/questions/previous_postcode_known.rb +++ b/app/models/form/sales/questions/previous_postcode_known.rb @@ -10,6 +10,16 @@ class Form::Sales::Questions::PreviousPostcodeKnown < ::Form::Question "ppostcode_full" => [0], } @hint_text = "This is also known as the household’s 'last settled home'" + @hidden_in_check_answers = { + "depends_on" => [ + { + "ppcodenk" => 0, + }, + { + "ppcodenk" => 1, + }, + ], + } end ANSWER_OPTIONS = { diff --git a/spec/models/form/sales/questions/previous_postcode_known_spec.rb b/spec/models/form/sales/questions/previous_postcode_known_spec.rb index 6febe027f..b1d244b1e 100644 --- a/spec/models/form/sales/questions/previous_postcode_known_spec.rb +++ b/spec/models/form/sales/questions/previous_postcode_known_spec.rb @@ -47,4 +47,13 @@ RSpec.describe Form::Sales::Questions::PreviousPostcodeKnown, type: :model do it "has the correct hint" do expect(question.hint_text).to eq("This is also known as the household’s 'last settled home'") end + + it "has the correct hidden_in_check_answers" do + expect(question.hidden_in_check_answers).to eq({ + "depends_on" => [ + { "ppcodenk" => 0 }, + { "ppcodenk" => 1 }, + ], + }) + end end