Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhian Moraes committed Jun 28, 2021
1 parent 4bed92b commit 8e51c91
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
16 changes: 9 additions & 7 deletions app/javascript/src/case_contact.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Swal from 'sweetalert2'

/* global alert $ */
window.onload = function () {
const milesDriven = document.getElementById('case_contact_miles_driven')
Expand Down Expand Up @@ -121,22 +123,22 @@ window.onload = function () {
}
}

async function displayFollowupAlert() {
const { value: text, isConfirmed } = await fireSwalFollowupAlert();
async function displayFollowupAlert () {
const { value: text, isConfirmed } = await fireSwalFollowupAlert()

if(!isConfirmed) return;
if (!isConfirmed) return

const params = text ? { note: text } : {}
const caseContactId = this.id.replace('followup-button-', '');
const caseContactId = this.id.replace('followup-button-', '')

$.post(
`/case_contacts/${caseContactId}/followups`,
params,
() => location.reload()
);
() => window.location.reload()
)
}

async function fireSwalFollowupAlert() {
async function fireSwalFollowupAlert () {
const inputLabel = 'Optional: Add a note about what followup is needed.'

return await Swal.fire({
Expand Down
4 changes: 2 additions & 2 deletions spec/requests/followups_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

context "no followup exists yet" do
context "when a note is provided" do
let(:params) { { note: "Hello, world!" } }
let(:params) { {note: "Hello, world!"} }

it "creates a followup" do
expect { create_request }.to change(Followup, :count).by(1)
Expand All @@ -77,7 +77,7 @@
end

context "when a note is not provided" do
let(:params) { { note: nil } }
let(:params) { {note: nil} }

it "creates a followup" do
expect { create_request }.to change(Followup, :count).by(1)
Expand Down
2 changes: 1 addition & 1 deletion spec/system/notifications/index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
let(:case_contact) { create(:case_contact, creator: volunteer) }
let(:casa_case) { case_contact.casa_case }

before { casa_case.assigned_volunteers << volunteer}
before { casa_case.assigned_volunteers << volunteer }

context "FollowupResolvedNotification" do
let(:notification_message) { "#{volunteer.display_name} resolved a follow up. Click to see more." }
Expand Down

0 comments on commit 8e51c91

Please sign in to comment.