Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the new slot API for the modal #3120

Merged
merged 1 commit into from
Jan 18, 2024
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
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