From 88ab8cbb8a5a9020f5b8202f41bdf433da8e8872 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 22 Apr 2022 16:55:08 +0100 Subject: [PATCH 1/2] Remove H2 tag from label if question is conditional --- app/helpers/question_view_helper.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/question_view_helper.rb b/app/helpers/question_view_helper.rb index 5d85b2fa7..8096bd930 100644 --- a/app/helpers/question_view_helper.rb +++ b/app/helpers/question_view_helper.rb @@ -20,6 +20,8 @@ private end def label_tag(page_header, conditional) - page_header.blank? && !conditional ? "h1" : "h2" + return "" if conditional + + page_header.blank? ? "h1" : "h2" end end From 5865c1b8b0b0edc5e24b7e62d176aa53f3143f9c Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Fri, 22 Apr 2022 17:00:10 +0100 Subject: [PATCH 2/2] Spec --- spec/helpers/question_view_helper_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/helpers/question_view_helper_spec.rb b/spec/helpers/question_view_helper_spec.rb index 33341b0e5..1bfb3cb38 100644 --- a/spec/helpers/question_view_helper_spec.rb +++ b/spec/helpers/question_view_helper_spec.rb @@ -69,6 +69,7 @@ RSpec.describe QuestionViewHelper do context "when viewinng a conditional question" do let(:conditional) { true } + let(:tag) { "" } it "returns an options hash with a medium question header" do expect(question_view_helper).to eq(legend_options_hash)