Browse Source

Merge pull request #491 from communitiesuk/remove_h2_from_conditional_question_labels

Remove H2 tag from label if question is conditional
pull/494/head
baarkerlounger 3 years ago committed by GitHub
parent
commit
07e18eac3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/helpers/question_view_helper.rb
  2. 1
      spec/helpers/question_view_helper_spec.rb

4
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

1
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)

Loading…
Cancel
Save