diff --git a/app/views/form/page.html.erb b/app/views/form/page.html.erb
index 0d292ec42..6d2d1888d 100644
--- a/app/views/form/page.html.erb
+++ b/app/views/form/page.html.erb
@@ -14,14 +14,13 @@
<%= form_with action: '/case_logs', method: "next_page", builder: GOVUKDesignSystemFormBuilder::FormBuilder do |f| %>
<% page_info["questions"].map do |question_key, question| %>
-
>
- <%= render partial: "form/#{question["type"]}_question", locals: { question_key: question_key, question: question, f: f } %>
-
<% if conditional_questions_for_page(page_info).include?(question_key) %>
-
+ style="display:none;">
+ <% else %>
+
>
<% end %>
+ <%= render partial: "form/#{question["type"]}_question", locals: { question_key: question_key, question: question, f: f } %>
+
<% end %>
<%= f.hidden_field :previous_page, value: page_key %>
diff --git a/spec/features/case_log_spec.rb b/spec/features/case_log_spec.rb
index 4efc07f8b..31aecbe3c 100644
--- a/spec/features/case_log_spec.rb
+++ b/spec/features/case_log_spec.rb
@@ -96,4 +96,13 @@ RSpec.describe "Test Features" do
end
end
end
+
+ describe "Conditional questions" do
+ context "given a page where some questions are only conditionally shown, depending on how you answer the first question" do
+ it "initially hides conditional questions" do
+ visit("/case_logs/#{id}/armed_forces")
+ expect(page).to have_selector("#armed_forces_injured_div", visible: :hidden)
+ end
+ end
+ end
end