-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
[#1733] Add option to remove Court Mandates #1802
[#1733] Add option to remove Court Mandates #1802
Conversation
|
||
RSpec.describe "/case_court_mandates", type: :request do | ||
let(:case_court_mandate) { build(:case_court_mandate) } | ||
let(:delete_request) { delete case_court_mandate_url(case_court_mandate) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this let
should be a subject
spec/system/casa_cases/edit_spec.rb
Outdated
let(:casa_case) { create(:casa_case) } | ||
let(:mandate) { build(:case_court_mandate) } | ||
|
||
before do | ||
casa_case.case_court_mandates << mandate | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic is repeated in your tests. It'd be nice to avoid this repetition by using a trait within your factory.
@case_court_mandate.destroy | ||
end | ||
|
||
def set_case_court_mandate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method should be private
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@@ -10,6 +10,57 @@ id="casa_case_case_court_mandates_attributes_1_mandate_text">\ | |||
$(list).children(':last').trigger('focus') | |||
} | |||
|
|||
function remove_mandate_with_confirmation () { | |||
Swal.fire({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swal!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice :)
Yay tests!
What github issue is this PR for, if any?
Resolves #1733
What changed, and why?
When implementing #1795 I added an option to add and edit Court Mandates in the CASA Case Edit page.
Now I've implemented a way to delete Court Mandates that have already been saved in the database.
To "delete" a court mandate that has not been saved yet, the process remains the same: just empty the field.
How will this affect user permissions?
How is this tested? (please write tests!) 💖💪
Automated tests
Request specs
For each type of user in the system (volunteers, admins and supervisors) I tested:
Frontend specs
Manual testing
Screenshots please :)
Overview
Dialog box
Success message
After deletion
Mobile view
Mobile view of the dialog box
Mobile view of the success dialog box