Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/components/blacklight/response/facet_group_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ def button_component
end

def render?
# debugger
body.present?
body.to_s.present?
end
end
end
Expand Down
16 changes: 16 additions & 0 deletions spec/components/blacklight/response/facet_group_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,20 @@
end
end
end

context "when no facets within the group render" do
let(:instance) do
described_class.new(id: 'foo', title: 'bar').tap do |component|
component.with_body { ViewComponent::Slot.new("\n") }
end
end

it "does not render" do
expect(instance.render?).to eq false

within '.facets' do
expect(page).not_to have_css 'div.facets-collapse.d-lg-block.collapse.accordion'
end
end
end
end
Loading