From 609c9ba91e7b779cd2912e2bfe9203be027fa607 Mon Sep 17 00:00:00 2001 From: natdeanlewissoftwire <94526761+natdeanlewissoftwire@users.noreply.github.com> Date: Thu, 23 Feb 2023 14:43:05 +0000 Subject: [PATCH] feat: add hidden_in_check_answers (#1325) --- .../form/sales/questions/previous_postcode_known.rb | 10 ++++++++++ .../sales/questions/previous_postcode_known_spec.rb | 9 +++++++++ 2 files changed, 19 insertions(+) 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