-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: dont send lottery emails to duplicate applications (#4346)
- Loading branch information
1 parent
a62f73b
commit cba63b1
Showing
4 changed files
with
87 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1032,9 +1032,12 @@ describe('Lottery Controller Tests', () => { | |
confirmationCode: 'ABCD1234', | ||
submissionType: ApplicationSubmissionTypeEnum.electronical, | ||
language: LanguagesEnum.en, | ||
applicant: { | ||
userAccounts: { | ||
create: { | ||
emailAddress: '[email protected]', | ||
email: '[email protected]', | ||
firstName: 'first', | ||
lastName: 'last', | ||
passwordHash: 'abcd1234', | ||
}, | ||
}, | ||
}, | ||
|
@@ -1044,9 +1047,12 @@ describe('Lottery Controller Tests', () => { | |
confirmationCode: 'EFGH5678', | ||
submissionType: ApplicationSubmissionTypeEnum.electronical, | ||
language: LanguagesEnum.es, | ||
applicant: { | ||
userAccounts: { | ||
create: { | ||
emailAddress: '[email protected]', | ||
email: '[email protected]', | ||
firstName: 'first', | ||
lastName: 'last', | ||
passwordHash: 'abcd1234', | ||
}, | ||
}, | ||
}, | ||
|
@@ -1056,9 +1062,24 @@ describe('Lottery Controller Tests', () => { | |
confirmationCode: 'IJKL9012', | ||
submissionType: ApplicationSubmissionTypeEnum.electronical, | ||
language: null, | ||
userAccounts: { | ||
create: { | ||
email: '[email protected]', | ||
firstName: 'first', | ||
lastName: 'last', | ||
passwordHash: 'abcd1234', | ||
}, | ||
}, | ||
}, | ||
{ | ||
preferences: [], | ||
status: ApplicationStatusEnum.submitted, | ||
confirmationCode: 'MNOP3456', | ||
submissionType: ApplicationSubmissionTypeEnum.electronical, | ||
language: null, | ||
applicant: { | ||
create: { | ||
emailAddress: 'applicant3@email.com', | ||
emailAddress: 'applicant4@email.com', | ||
}, | ||
}, | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -615,11 +615,9 @@ describe('Testing lottery service', () => { | |
emails: ['[email protected]', '[email protected]'], | ||
}); | ||
|
||
jest | ||
.spyOn(listingService, 'getPublicUserEmailInfo') | ||
.mockResolvedValueOnce({ | ||
en: ['[email protected]'], | ||
}); | ||
jest.spyOn(service, 'getPublicUserEmailInfo').mockResolvedValueOnce({ | ||
en: ['[email protected]'], | ||
}); | ||
|
||
await service.lotteryStatus( | ||
{ | ||
|
@@ -671,11 +669,9 @@ describe('Testing lottery service', () => { | |
jest.spyOn(listingService, 'getUserEmailInfo').mockResolvedValueOnce({ | ||
emails: ['[email protected]', '[email protected]'], | ||
}); | ||
jest | ||
.spyOn(listingService, 'getPublicUserEmailInfo') | ||
.mockResolvedValueOnce({ | ||
en: ['[email protected]'], | ||
}); | ||
jest.spyOn(service, 'getPublicUserEmailInfo').mockResolvedValueOnce({ | ||
en: ['[email protected]'], | ||
}); | ||
|
||
await expect( | ||
async () => | ||
|
@@ -716,11 +712,9 @@ describe('Testing lottery service', () => { | |
jest.spyOn(listingService, 'getUserEmailInfo').mockResolvedValueOnce({ | ||
emails: ['[email protected]', '[email protected]'], | ||
}); | ||
jest | ||
.spyOn(listingService, 'getPublicUserEmailInfo') | ||
.mockResolvedValueOnce({ | ||
en: ['[email protected]'], | ||
}); | ||
jest.spyOn(service, 'getPublicUserEmailInfo').mockResolvedValueOnce({ | ||
en: ['[email protected]'], | ||
}); | ||
|
||
await service.lotteryStatus( | ||
{ | ||
|
@@ -828,11 +822,9 @@ describe('Testing lottery service', () => { | |
lotteryStatus: LotteryStatusEnum.ran, | ||
}); | ||
prisma.jurisdictions.findFirst = jest.fn().mockResolvedValue(null); | ||
jest | ||
.spyOn(listingService, 'getPublicUserEmailInfo') | ||
.mockResolvedValueOnce({ | ||
en: ['[email protected]'], | ||
}); | ||
jest.spyOn(service, 'getPublicUserEmailInfo').mockResolvedValueOnce({ | ||
en: ['[email protected]'], | ||
}); | ||
|
||
jest.spyOn(listingService, 'getUserEmailInfo').mockResolvedValueOnce({ | ||
emails: ['[email protected]', '[email protected]'], | ||
|