Skip to content

Commit

Permalink
feat: ajoute la condition d'envoi du sondage de 3 jours supplémentair…
Browse files Browse the repository at this point in the history
…es après l'envoi du sondage par email
  • Loading branch information
Shamzic committed Nov 17, 2023
1 parent 9fd539b commit eb22f1c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/unit/lib/messaging/messaging-sms.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@ describe("shouldSendSurveyBySms condition tests", () => {
beforeEach(() => {
followup = {
surveys: [],
phone: "0607080910",
phone: "0600000000",
email: "test@test.fr",
createdAt: dayjs("2023-11-17"),
sentAt: dayjs("2023-11-17"),
smsSentAt: dayjs("2023-11-17"),
smsSurveySentAt: dayjs("2023-11-17"),
}
})

it("should not sent sms without phone field inside the followup", async () => {
followup.phone = undefined
expect(shouldSendSurveyBySms(followup, dayjs("2023-11-19"))).toBe(false)
})

it("should sent sms without email field inside the followup", async () => {
followup.email = undefined
expect(shouldSendSurveyBySms(followup, dayjs("2023-11-19"))).toBe(true)
Expand Down

0 comments on commit eb22f1c

Please sign in to comment.