Skip to content
Merged
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
7 changes: 7 additions & 0 deletions app/presenters/orangelight/clause_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,12 @@ def label
super
end
end

# We will no longer need to override #field_label when/if we
# use a release of Blacklight that includes
# https://github.com/projectblacklight/blacklight/pull/3442
def field_label
field_config&.display_label('search')
end
end
end
13 changes: 13 additions & 0 deletions spec/presenters/orangelight/clause_presenter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,17 @@
expect(subject.label).to eq 'NOT some search string'
end
end
describe '#field_label' do
context 'when the field config does not exist' do
let(:field_config) { nil }

it 'returns nil' do
expect(subject.field_label).to be_nil
end

it 'does not raise an error' do
expect { subject.field_label }.not_to raise_error
end
end
end
end