From 49021f37e57c0c26e020673b6164dbf8373107fc Mon Sep 17 00:00:00 2001 From: Morgan Ludtke Date: Tue, 17 Dec 2024 12:26:09 -0600 Subject: [PATCH] fix: update email service tests --- api/test/integration/listing.e2e-spec.ts | 5 + api/test/integration/user.e2e-spec.ts | 12 +- api/test/unit/services/email.service.spec.ts | 468 ++++++++++++------ .../unit/services/lottery.service.spec.ts | 2 +- 4 files changed, 316 insertions(+), 171 deletions(-) diff --git a/api/test/integration/listing.e2e-spec.ts b/api/test/integration/listing.e2e-spec.ts index c93bfb710f..d1b67ead94 100644 --- a/api/test/integration/listing.e2e-spec.ts +++ b/api/test/integration/listing.e2e-spec.ts @@ -962,6 +962,11 @@ describe('Listing Controller Tests', () => { }, }, }); + const emailEntries = + mockSeSClient.call(0).args[0].input['BulkEmailEntries']; + expect(emailEntries).not.toContain({ + Destination: { ToAddresses: [wrongJurisAdmin.email] }, + }); }); it('update status to listing approved and notify appropriate users', async () => { diff --git a/api/test/integration/user.e2e-spec.ts b/api/test/integration/user.e2e-spec.ts index 32f06d7578..61ea1ac563 100644 --- a/api/test/integration/user.e2e-spec.ts +++ b/api/test/integration/user.e2e-spec.ts @@ -36,21 +36,11 @@ describe('User Controller Tests', () => { const mockSeSClient = mockClient(SESv2Client); - // const invitePartnerUserMock = jest.fn(); - // const testEmailService = { - // confirmation: jest.fn(), - // welcome: jest.fn(), - // invitePartnerUser: invitePartnerUserMock, - // changeEmail: jest.fn(), - // forgotPassword: jest.fn(), - // sendMfaCode: jest.fn(), - // }; - beforeEach(() => { jest.resetAllMocks(); mockSeSClient.reset(); mockSeSClient.on(SendEmailCommand).resolves({ - MessageId: 'morgan', + MessageId: randomUUID(), $metadata: { httpStatusCode: 200, }, diff --git a/api/test/unit/services/email.service.spec.ts b/api/test/unit/services/email.service.spec.ts index 25b87f2993..809a2b333c 100644 --- a/api/test/unit/services/email.service.spec.ts +++ b/api/test/unit/services/email.service.spec.ts @@ -17,6 +17,14 @@ import { ApplicationCreate } from '../../../src/dtos/applications/application-cr import { of } from 'rxjs'; import { HttpService } from '@nestjs/axios'; import { Logger } from '@nestjs/common'; +import { mockClient } from 'aws-sdk-client-mock'; +import { + SendBulkEmailCommand, + SendEmailCommand, + SESv2Client, +} from '@aws-sdk/client-sesv2'; +import 'aws-sdk-client-mock-jest'; +import { randomUUID } from 'crypto'; let sendSingleMock, sendBulkMock; const translationServiceMock = { @@ -42,6 +50,7 @@ const httpServiceMock = { describe('Testing email service', () => { let service: EmailService; let module: TestingModule; + const mockSeSClient = mockClient(SESv2Client); beforeAll(async () => { module = await Test.createTestingModule({ @@ -65,11 +74,20 @@ describe('Testing email service', () => { beforeEach(async () => { jest.useFakeTimers(); - sendSingleMock = jest.fn(); - sendBulkMock = jest.fn(); + mockSeSClient.reset(); + mockSeSClient.on(SendEmailCommand).resolves({ + MessageId: randomUUID(), + $metadata: { + httpStatusCode: 200, + }, + }); + mockSeSClient.on(SendBulkEmailCommand).resolves({ + BulkEmailEntryResults: [], + $metadata: { + httpStatusCode: 200, + }, + }); service = await module.resolve(EmailService); - service.sendSingleSES = sendSingleMock; - service.sendBulkSES = sendBulkMock; }); const user = { @@ -86,12 +104,25 @@ describe('Testing email service', () => { 'http://localhost:3000', 'http://localhost:3000/?token=', ); - expect(sendSingleMock).toHaveBeenCalled(); - expect(sendSingleMock.mock.calls[0][0].to).toEqual(user.email); - expect(sendSingleMock.mock.calls[0][0].subject).toEqual('Welcome'); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'Thank you for setting up your account on http://localhost:3000.', - ); + + expect(mockSeSClient).toHaveReceivedCommandWith(SendEmailCommand, { + FromEmailAddress: 'Doorway ', + Destination: { ToAddresses: [user.email] }, + Content: { + Simple: { + Subject: { + Data: 'Welcome', + }, + Body: { + Html: { + Data: expect.stringContaining( + 'Thank you for setting up your account on http://localhost:3000.', + ), + }, + }, + }, + }, + }); }); it('testing invite email', async () => { @@ -104,17 +135,24 @@ describe('Testing email service', () => { 'http://localhost:3001', 'http://localhost:3001/?token=', ); - expect(sendSingleMock).toHaveBeenCalled(); - expect(sendSingleMock.mock.calls[0][0].to).toEqual(user.email); - expect(sendSingleMock.mock.calls[0][0].subject).toEqual( - 'Welcome to the Partners Portal', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'Welcome to the Partners Portal at http://localhost:3001', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'You will now be able to manage listings and applications that you are a part of from one centralized location.', - ); + expect(mockSeSClient).toHaveReceivedCommandWith(SendEmailCommand, { + FromEmailAddress: 'Doorway ', + Destination: { ToAddresses: [user.email] }, + Content: { + Simple: { + Subject: { + Data: 'Welcome to the Partners Portal', + }, + Body: { + Html: { + Data: expect.stringMatching( + 'Welcome to the Partners Portal at http://localhost:300(\n|.)*You will now be able to manage listings and applications that you are a part of from one centralized location', + ), + }, + }, + }, + }, + }); }); it('testing change email', async () => { @@ -125,20 +163,24 @@ describe('Testing email service', () => { 'http://localhost:3001/confirmation', 'newemail@example.com', ); - expect(sendSingleMock).toHaveBeenCalled(); - expect(sendSingleMock.mock.calls[0][0].to).toEqual('newemail@example.com'); - expect(sendSingleMock.mock.calls[0][0].subject).toEqual( - 'Bloom email change request', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'An email address change has been requested for your account.', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'To confirm the change to your email address, please click the link below:', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'Confirm email change', - ); + expect(mockSeSClient).toHaveReceivedCommandWith(SendEmailCommand, { + FromEmailAddress: 'Doorway ', + Destination: { ToAddresses: ['newemail@example.com'] }, + Content: { + Simple: { + Subject: { + Data: 'Bloom email change request', + }, + Body: { + Html: { + Data: expect.stringMatching( + 'An email address change has been requested for your account(\n|.)*To confirm the change to your email address, please click the link below:(\n|.)*Confirm email change', + ), + }, + }, + }, + }, + }); }); it('testing forgot password', async () => { @@ -152,21 +194,36 @@ describe('Testing email service', () => { 'http://localhost:3001', 'resetToken', ); - expect(sendSingleMock).toHaveBeenCalled(); - expect(sendSingleMock.mock.calls[0][0].to).toEqual(user.email); - expect(sendSingleMock.mock.calls[0][0].subject).toEqual( - 'Forgot your password?', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'A request to reset your Bloom Housing Portal website password for http://localhost:3001 has recently been made.', + expect(mockSeSClient).toHaveReceivedCommandWith(SendEmailCommand, { + FromEmailAddress: 'Doorway ', + Destination: { ToAddresses: ['bloom.bloomington@example.com'] }, + Content: { + Simple: { + Subject: { + Data: 'Forgot your password?', + }, + Body: { + Html: { + Data: expect.anything(), + }, + }, + }, + }, + }); + const html = + mockSeSClient.call(0).args[0].input['Content']['Simple']['Body']['Html'][ + 'Data' + ]; + expect(html).toContain( + 'A request to reset your Bloom Housing Portal website password for http://localhost:3001 has recently been made', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'If you did make this request, please click on the link below to reset your password:', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Change my password', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Your password won't change until you access the link above and create a new one.', ); }); @@ -182,21 +239,36 @@ describe('Testing email service', () => { 'http://localhost:3001?redirectUrl=redirect&listingId=123', 'resetToken', ); - expect(sendSingleMock).toHaveBeenCalled(); - expect(sendSingleMock.mock.calls[0][0].to).toEqual(user.email); - expect(sendSingleMock.mock.calls[0][0].subject).toEqual( - 'Forgot your password?', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'A request to reset your Bloom Housing Portal website password for http://localhost:3001 has recently been made.', + expect(mockSeSClient).toHaveReceivedCommandWith(SendEmailCommand, { + FromEmailAddress: 'Doorway ', + Destination: { ToAddresses: [user.email] }, + Content: { + Simple: { + Subject: { + Data: 'Forgot your password?', + }, + Body: { + Html: { + Data: expect.anything(), + }, + }, + }, + }, + }); + const html = + mockSeSClient.call(0).args[0].input['Content']['Simple']['Body']['Html'][ + 'Data' + ]; + expect(html).toContain( + 'A request to reset your Bloom Housing Portal website password for http://localhost:3001 has recently been made', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'If you did make this request, please click on the link below to reset your password:', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Change my password', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Your password won't change until you access the link above and create a new one.', ); }); @@ -239,29 +311,40 @@ describe('Testing email service', () => { application as ApplicationCreate, 'http://localhost:3001', ); - expect(sendSingleMock).toHaveBeenCalled(); - expect(sendSingleMock.mock.calls[0][0].to).toEqual( - 'applicant.email@example.com', - ); - expect(sendSingleMock.mock.calls[0][0].subject).toEqual( - 'Your Application Confirmation', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(mockSeSClient).toHaveReceivedCommandWith(SendEmailCommand, { + FromEmailAddress: 'Doorway ', + Destination: { ToAddresses: ['applicant.email@example.com'] }, + Content: { + Simple: { + Subject: { + Data: 'Your Application Confirmation', + }, + Body: { + Html: { + Data: expect.anything(), + }, + }, + }, + }, + }); + const html = + mockSeSClient.call(0).args[0].input['Content']['Simple']['Body'][ + 'Html' + ]['Data']; + expect(html).toContain( 'indication of step completed', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Application
received
', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'What happens next?', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain('What happens next?'); + expect(html).toContain( 'Eligible applicants will be contacted on a first come first serve basis until vacancies are filled.', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Housing preferences, if applicable, will affect first come first serve order.', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'If you are contacted for an interview, you will be asked to fill out a more detailed application and provide supporting documents', ); }); @@ -271,32 +354,43 @@ describe('Testing email service', () => { application as ApplicationCreate, 'http://localhost:3001', ); - expect(sendSingleMock).toHaveBeenCalled(); - expect(sendSingleMock.mock.calls[0][0].to).toEqual( - 'applicant.email@example.com', - ); - expect(sendSingleMock.mock.calls[0][0].subject).toEqual( - 'Your Application Confirmation', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(mockSeSClient).toHaveReceivedCommandWith(SendEmailCommand, { + FromEmailAddress: 'Doorway ', + Destination: { ToAddresses: ['applicant.email@example.com'] }, + Content: { + Simple: { + Subject: { + Data: 'Your Application Confirmation', + }, + Body: { + Html: { + Data: expect.anything(), + }, + }, + }, + }, + }); + const html = + mockSeSClient.call(0).args[0].input['Content']['Simple']['Body'][ + 'Html' + ]['Data']; + expect(html).toContain( 'indication of step completed', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Application
received
', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'What happens next?', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain('What happens next?'); + expect(html).toContain( 'Once the application period closes, eligible applicants will be placed in order based on lottery rank order.', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Housing preferences, if applicable, will affect lottery rank order.', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'If you are contacted for an interview, you will be asked to fill out a more detailed application and provide supporting documents', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'If you’re not changing the primary applicant or any household members, you can just submit another application. We’ll take the last one submitted, per the duplicate application policy.', ); }); @@ -306,32 +400,43 @@ describe('Testing email service', () => { application as ApplicationCreate, 'http://localhost:3001', ); - expect(sendSingleMock).toHaveBeenCalled(); - expect(sendSingleMock.mock.calls[0][0].to).toEqual( - 'applicant.email@example.com', - ); - expect(sendSingleMock.mock.calls[0][0].subject).toEqual( - 'Your Application Confirmation', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(mockSeSClient).toHaveReceivedCommandWith(SendEmailCommand, { + FromEmailAddress: 'Doorway ', + Destination: { ToAddresses: ['applicant.email@example.com'] }, + Content: { + Simple: { + Subject: { + Data: 'Your Application Confirmation', + }, + Body: { + Html: { + Data: expect.anything(), + }, + }, + }, + }, + }); + const html = + mockSeSClient.call(0).args[0].input['Content']['Simple']['Body'][ + 'Html' + ]['Data']; + expect(html).toContain( 'indication of step completed', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Application
received
', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( - 'What happens next?', - ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain('What happens next?'); + expect(html).toContain( 'Eligible applicants will be placed on the waitlist on a first come first serve basis until waitlist spots are filled.', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'Housing preferences, if applicable, will affect waitlist order.', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'If you are contacted for an interview, you will be asked to fill out a more detailed application and provide supporting documents', ); - expect(sendSingleMock.mock.calls[0][0].html).toContain( + expect(html).toContain( 'You may be contacted while on the waitlist to confirm that you wish to remain on the waitlist', ); }); @@ -339,7 +444,7 @@ describe('Testing email service', () => { describe('request approval', () => { it('should generate html body', async () => { - const emailArr = ['testOne@xample.com', 'testTwo@example.com']; + const emailArr = ['testOne@example.com', 'testTwo@example.com']; const service = await module.resolve(EmailService); await service.requestApproval( { name: 'test', id: '1234' }, @@ -347,41 +452,55 @@ describe('Testing email service', () => { emailArr, 'http://localhost:3001', ); + expect(mockSeSClient).toHaveReceivedCommandWith(SendBulkEmailCommand, { + FromEmailAddress: 'Doorway ', + BulkEmailEntries: expect.arrayContaining([ + { Destination: { ToAddresses: ['testOne@example.com'] } }, + { Destination: { ToAddresses: ['testTwo@example.com'] } }, + ]), + DefaultContent: { + Template: { + TemplateContent: { + Subject: `Listing approval requested`, + Html: expect.anything(), + }, + TemplateData: expect.anything(), + }, + }, + }); - expect(sendBulkMock).toHaveBeenCalled(); - const emailMock = sendBulkMock.mock.calls[0][0]; - expect(emailMock.emails).toEqual(emailArr); - expect(emailMock.subject).toEqual('Listing approval requested'); - expect(emailMock.html).toMatch( + const html = + mockSeSClient.call(0).args[0].input['DefaultContent']['Template'][ + 'TemplateContent' + ]['Html']; + expect(html).toMatch( `Bloom Housing Portal`, ); - expect(emailMock.html).toMatch('Hello,'); - expect(emailMock.html).toMatch('Listing approval requested'); - expect(emailMock.html).toMatch( + expect(html).toMatch('Hello,'); + expect(html).toMatch('Listing approval requested'); + expect(html).toMatch( `A Partner has submitted an approval request to publish the listing name listing.`, ); - expect(emailMock.html).toMatch('Please log into the'); - expect(emailMock.html).toMatch('Partners Portal'); - expect(emailMock.html).toMatch(/http:\/\/localhost:3001/); - expect(emailMock.html).toMatch( + expect(html).toMatch('Please log into the'); + expect(html).toMatch('Partners Portal'); + expect(html).toMatch(/http:\/\/localhost:3001/); + expect(html).toMatch( 'and navigate to the listing detail page to review and publish.', ); - expect(emailMock.html).toMatch( + expect(html).toMatch( 'To access the listing after logging in, please click the link below', ); - expect(emailMock.html).toMatch('Review Listing'); - expect(emailMock.html).toMatch( - /http:\/\/localhost:3001\/listings\/listingId/, - ); - expect(emailMock.html).toMatch('Thank you,'); - expect(emailMock.html).toMatch('Bloom Housing Portal'); + expect(html).toMatch('Review Listing'); + expect(html).toMatch(/http:\/\/localhost:3001\/listings\/listingId/); + expect(html).toMatch('Thank you,'); + expect(html).toMatch('Bloom Housing Portal'); }); }); describe('changes requested', () => { it('should generate html body', async () => { - const emailArr = ['testOne@xample.com', 'testTwo@example.com']; + const emailArr = ['testOne@example.com', 'testTwo@example.com']; const service = await module.resolve(EmailService); await service.changesRequested( { firstName: 'test', id: '1234' } as User, @@ -390,43 +509,58 @@ describe('Testing email service', () => { 'http://localhost:3001', ); - expect(sendBulkMock).toHaveBeenCalled(); - const emailMock = sendBulkMock.mock.calls[0][0]; - expect(emailMock.emails).toEqual(emailArr); - expect(emailMock.subject).toEqual('Listing changes requested'); - expect(emailMock.html).toMatch( + expect(mockSeSClient).toHaveReceivedCommandWith(SendBulkEmailCommand, { + FromEmailAddress: 'Doorway ', + BulkEmailEntries: expect.arrayContaining([ + { Destination: { ToAddresses: ['testOne@example.com'] } }, + { Destination: { ToAddresses: ['testTwo@example.com'] } }, + ]), + DefaultContent: { + Template: { + TemplateContent: { + Subject: `Listing changes requested`, + Html: expect.anything(), + }, + TemplateData: expect.anything(), + }, + }, + }); + + const html = + mockSeSClient.call(0).args[0].input['DefaultContent']['Template'][ + 'TemplateContent' + ]['Html']; + expect(html).toMatch( `Bloom Housing Portal`, ); - expect(emailMock.html).toMatch('Listing changes requested'); - expect(emailMock.html).toMatch('Hello,'); - expect(emailMock.html).toMatch( + expect(html).toMatch('Listing changes requested'); + expect(html).toMatch('Hello,'); + expect(html).toMatch( `An administrator is requesting changes to the listing name listing. Please log into the `, ); - expect(emailMock.html).toMatch('Partners Portal'); - expect(emailMock.html).toMatch(/http:\/\/localhost:3001/); + expect(html).toMatch('Partners Portal'); + expect(html).toMatch(/http:\/\/localhost:3001/); - expect(emailMock.html).toMatch( + expect(html).toMatch( ' and navigate to the listing detail page to view the request and edit the listing.', ); - expect(emailMock.html).toMatch( + expect(html).toMatch( 'and navigate to the listing detail page to view the request and edit the listing.', ); - expect(emailMock.html).toMatch(/http:\/\/localhost:3001/); - expect(emailMock.html).toMatch( + expect(html).toMatch(/http:\/\/localhost:3001/); + expect(html).toMatch( 'To access the listing after logging in, please click the link below', ); - expect(emailMock.html).toMatch('Edit Listing'); - expect(emailMock.html).toMatch( - /http:\/\/localhost:3001\/listings\/listingId/, - ); - expect(emailMock.html).toMatch('Thank you,'); - expect(emailMock.html).toMatch('Bloom Housing Portal'); + expect(html).toMatch('Edit Listing'); + expect(html).toMatch(/http:\/\/localhost:3001\/listings\/listingId/); + expect(html).toMatch('Thank you,'); + expect(html).toMatch('Bloom Housing Portal'); }); }); describe('published listing', () => { it('should generate html body', async () => { - const emailArr = ['testOne@xample.com', 'testTwo@example.com']; + const emailArr = ['testOne@example.com', 'testTwo@example.com']; const service = await module.resolve(EmailService); await service.listingApproved( { name: 'test jurisdiction', id: 'jurisdictionId' }, @@ -435,27 +569,43 @@ describe('Testing email service', () => { 'http://localhost:3000', ); - expect(sendBulkMock).toHaveBeenCalled(); - const emailMock = sendBulkMock.mock.calls[0][0]; - expect(emailMock.emails).toEqual(emailArr); - expect(emailMock.subject).toEqual('New published listing'); - expect(emailMock.html).toMatch( + expect(mockSeSClient).toHaveReceivedCommandWith(SendBulkEmailCommand, { + FromEmailAddress: 'Doorway ', + BulkEmailEntries: expect.arrayContaining([ + { Destination: { ToAddresses: ['testOne@example.com'] } }, + { Destination: { ToAddresses: ['testTwo@example.com'] } }, + ]), + DefaultContent: { + Template: { + TemplateContent: { + Subject: `New published listing`, + Html: expect.anything(), + }, + TemplateData: expect.anything(), + }, + }, + }); + + const html = + mockSeSClient.call(0).args[0].input['DefaultContent']['Template'][ + 'TemplateContent' + ]['Html']; + + expect(html).toMatch( `Bloom Housing Portal`, ); - expect(emailMock.html).toMatch('New published listing'); - expect(emailMock.html).toMatch('Hello,'); - expect(emailMock.html).toMatch( + expect(html).toMatch('New published listing'); + expect(html).toMatch('Hello,'); + expect(html).toMatch( `The listing name listing has been approved and published by an administrator.`, ); - expect(emailMock.html).toMatch( + expect(html).toMatch( 'To view the published listing, please click on the link below', ); - expect(emailMock.html).toMatch('View Listing'); - expect(emailMock.html).toMatch( - /http:\/\/localhost:3000\/listing\/listingId/, - ); - expect(emailMock.html).toMatch('Thank you,'); - expect(emailMock.html).toMatch('Bloom Housing Portal'); + expect(html).toMatch('View Listing'); + expect(html).toMatch(/http:\/\/localhost:3000\/listing\/listingId/); + expect(html).toMatch('Thank you,'); + expect(html).toMatch('Bloom Housing Portal'); }); }); }); diff --git a/api/test/unit/services/lottery.service.spec.ts b/api/test/unit/services/lottery.service.spec.ts index d1596dde73..5c642c381f 100644 --- a/api/test/unit/services/lottery.service.spec.ts +++ b/api/test/unit/services/lottery.service.spec.ts @@ -658,7 +658,7 @@ describe('Testing lottery service', () => { it.todo('should update status to errored'); - it.only('should update status to releasedToPartners from ran and send email', async () => { + it('should update status to releasedToPartners from ran and send email', async () => { prisma.listings.findUnique = jest.fn().mockResolvedValue({ id: 'example id', name: 'example name',