diff --git a/app/views/form/_textarea_question.html.erb b/app/views/form/_textarea_question.html.erb new file mode 100644 index 000000000..b9644496e --- /dev/null +++ b/app/views/form/_textarea_question.html.erb @@ -0,0 +1,7 @@ +<%= f.govuk_text_area question.id.to_sym, + caption: caption && !page_header.present? ? { text: caption.html_safe, size: "l" } : nil, + label: { text: question.header.html_safe, size: !page_header.present? ? "l" : "m", tag: !page_header.present? ? "h1" : "h2" }, + hint: { text: question.hint_text }, + width: question.width ? question.width : nil, + **stimulus_html_attributes(question) +%> diff --git a/config/forms/2021_2022.json b/config/forms/2021_2022.json index 5d24ddc84..a9b458c2e 100644 --- a/config/forms/2021_2022.json +++ b/config/forms/2021_2022.json @@ -1483,7 +1483,7 @@ "check_answer_label": "Reason for not knowing local authority", "header": "Give a reason why you don’t know the postcode or local authority", "hint_text": "", - "type": "text" + "type": "textarea" } }, "depends_on": { "la_known": "No" } diff --git a/spec/fixtures/forms/test_form.json b/spec/fixtures/forms/test_form.json index 95add8988..71d002e13 100644 --- a/spec/fixtures/forms/test_form.json +++ b/spec/fixtures/forms/test_form.json @@ -532,6 +532,18 @@ } } }, + "why_dont_you_know_la": { + "header": "", + "description": "", + "questions": { + "why_dont_you_know_la": { + "check_answer_label": "Reason for not knowing local authority", + "header": "Give a reason why you don’t know the postcode or local authority", + "hint_text": "", + "type": "textarea" + } + } + }, "property_postcode": { "questions": { "property_postcode": { diff --git a/spec/models/form_handler_spec.rb b/spec/models/form_handler_spec.rb index 89cb98542..e87765aac 100644 --- a/spec/models/form_handler_spec.rb +++ b/spec/models/form_handler_spec.rb @@ -15,7 +15,7 @@ RSpec.describe FormHandler do form_handler = FormHandler.instance form = form_handler.get_form("test_form") expect(form).to be_a(Form) - expect(form.pages.count).to eq(24) + expect(form.pages.count).to eq(25) end end