File tree 2 files changed +30
-1
lines changed
2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change 11
11
12
12
<%= render "content_items/manuals/manual_layout" do %>
13
13
<% @content_item.section_groups.each do |group| %>
14
+ <% next unless group["child_sections"].present? %>
14
15
<div class ="subsection-collection ">
15
16
<%= render "content_items/manuals/hmrc_sections" , group : group %>
16
17
</ div >
17
18
<% end %>
18
- <% end %>
19
+ <% end %>
Original file line number Diff line number Diff line change @@ -89,4 +89,32 @@ class HmrcManualTest < ActionDispatch::IntegrationTest
89
89
end
90
90
end
91
91
end
92
+
93
+ test "does not render section groups with no sections inside" do
94
+ content_item_override = {
95
+ "details" => {
96
+ "child_section_groups" => [
97
+ {
98
+ title : "Some section group title 1" ,
99
+ child_sections : [ ] ,
100
+ } ,
101
+ {
102
+ title : "Some section group title 2" ,
103
+ child_sections : [
104
+ {
105
+ "section_id" => "VATGPB1000" ,
106
+ "title" => "Introduction: contents" ,
107
+ "description" => "" ,
108
+ "base_path" => "/hmrc-internal-manuals/vat-government-and-public-bodies/vatgpb1000" ,
109
+ } ,
110
+ ] ,
111
+ } ,
112
+ ] ,
113
+ } ,
114
+ }
115
+
116
+ setup_and_visit_content_item ( "vat-government-public-bodies" , content_item_override )
117
+ assert page . has_no_text? ( "Some section group title 1" )
118
+ assert page . has_text? ( "Some section group title 2" )
119
+ end
92
120
end
You can’t perform that action at this time.
0 commit comments