Skip to content

Commit

Permalink
Merge pull request #3120 from projectblacklight/email-slots
Browse files Browse the repository at this point in the history
Use the new slot API for the modal
  • Loading branch information
jcoyne committed Jan 18, 2024
2 parents 8eb4d3a + c427b40 commit a36d8fb
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/views/catalog/_citation.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render Blacklight::System::ModalComponent.new do |component| %>
<% component.title { t('blacklight.tools.citation') } %>
<% component.with_title { t('blacklight.tools.citation') } %>
<%= render Blacklight::Document::CitationComponent.with_collection(@documents) if @documents.present? %>
<% end %>
4 changes: 2 additions & 2 deletions app/views/catalog/email.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= render Blacklight::System::ModalComponent.new do |component| %>
<% component.title { t('blacklight.email.form.title') } %>
<% component.with_title { t('blacklight.email.form.title') } %>
<% component.body do %>
<% component.with_body do %>
<%= render 'email_form' %>
<% end %>
<% end %>
4 changes: 2 additions & 2 deletions app/views/catalog/sms.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= render Blacklight::System::ModalComponent.new do |component| %>
<% component.title { t('blacklight.sms.form.title') } %>
<% component.with_title { t('blacklight.sms.form.title') } %>
<% component.body do %>
<% component.with_body do %>
<%= render 'sms_form' %>
<% end %>
<% end %>
10 changes: 10 additions & 0 deletions spec/features/citation_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

RSpec.describe 'Citation functionality' do
before { visit solr_document_path('2007020969') }

it 'displays the Cite modal with expected header' do
click_link 'Cite'
expect(find('div.modal-header')).to have_text 'Cite'
end
end
12 changes: 12 additions & 0 deletions spec/features/sms_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

RSpec.describe 'SMS functionality' do
before { visit solr_document_path('2007020969') }

it 'displays SMS modal with form' do
click_link 'SMS'
expect(find('div.modal-header')).to have_text 'SMS This'
fill_in 'Phone Number:', with: '555-555-5555'
select 'Verizon', from: 'Carrier'
end
end

0 comments on commit a36d8fb

Please sign in to comment.