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
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<div class="title-wrapper pt-30">
<div class="row align-items-center">
<div class="title mb-30">
<h1>Case Contacts</h1>
</div>
<div class="d-flex justify-content-between align-items-center flex-wrap gap-2 mb-30">
<h1>Case Contacts</h1>
<%= link_to new_case_contact_path, class: "main-btn primary-btn btn-sm btn-hover" do %>
<i class="lni lni-plus mr-10" aria-hidden="true"></i>
New Case Contact
<% end %>
</div>
</div>

Expand Down
31 changes: 31 additions & 0 deletions spec/system/case_contacts/case_contacts_new_design_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,37 @@
end
end

describe "New Case Contact button" do
include_context "signed in as admin"

it "is visible to an admin" do
expect(page).to have_link("New Case Contact", href: new_case_contact_path)
end

it "navigates to the new case contact form when clicked as an admin" do
click_link "New Case Contact"
expect(page).to have_current_path(%r{/case_contacts/\d+/form/details})
end

context "when signed in as a volunteer" do
let(:volunteer) { create(:volunteer, casa_org: organization) }

before do
sign_in volunteer
visit case_contacts_new_design_path
end

it "is visible to a volunteer" do
expect(page).to have_link("New Case Contact", href: new_case_contact_path)
end

it "navigates to the new case contact form when clicked as a volunteer" do
click_link "New Case Contact"
expect(page).to have_current_path(%r{/case_contacts/\d+/form/details})
end
end
end

describe "row expansion" do
include_context "signed in as admin"
it "shows the expanded content after clicking the chevron" do
Expand Down
Loading