From d6f72a939e056e99f4326e2399b4f38beb1dbb38 Mon Sep 17 00:00:00 2001 From: Ken Date: Tue, 4 Jun 2024 16:22:52 +0800 Subject: [PATCH] update sms error import path --- .../__tests__/public-forms.verification.routes.spec.ts | 2 +- .../routes/api/v3/user/__tests__/user.routes.spec.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts b/src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts index f915ce3623..a0baa88ff0 100644 --- a/src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts +++ b/src/app/routes/api/v3/forms/__tests__/public-forms.verification.routes.spec.ts @@ -22,7 +22,7 @@ import { } from 'src/app/modules/verification/__tests__/verification.test.helpers' import getVerificationModel from 'src/app/modules/verification/verification.model' import MailService from 'src/app/services/mail/mail.service' -import { SmsSendError } from 'src/app/services/sms/sms.errors' +import { SmsSendError } from 'src/app/services/postman-sms/postman-sms.errors' import * as SmsService from 'src/app/services/sms/sms.service' import * as OtpUtils from 'src/app/utils/otp' import { IVerificationSchema } from 'src/types' diff --git a/src/app/routes/api/v3/user/__tests__/user.routes.spec.ts b/src/app/routes/api/v3/user/__tests__/user.routes.spec.ts index 79f7177548..23a91630f5 100644 --- a/src/app/routes/api/v3/user/__tests__/user.routes.spec.ts +++ b/src/app/routes/api/v3/user/__tests__/user.routes.spec.ts @@ -10,8 +10,8 @@ import supertest, { Session } from 'supertest-session' import getUserModel from 'src/app/models/user.server.model' import { UNAUTHORIZED_USER_MESSAGE } from 'src/app/modules/user/user.constant' -import { SmsSendError } from 'src/app/services/sms/sms.errors' -import * as SmsService from 'src/app/services/sms/sms.service' +import { SmsSendError } from 'src/app/services/postman-sms/postman-sms.errors' +import PostmanSmsService from 'src/app/services/postman-sms/postman-sms.service' import * as OtpUtils from 'src/app/utils/otp' import { AgencyDocument, IUserSchema } from 'src/types' @@ -113,7 +113,7 @@ describe('user.routes', () => { // Arrange const session = await createAuthedSession(defaultUser.email, request) const sendSmsOtpSpy = jest - .spyOn(SmsService, 'sendAdminContactOtp') + .spyOn(PostmanSmsService, 'sendAdminContactOtp') .mockReturnValueOnce(okAsync(true)) // Act @@ -205,7 +205,7 @@ describe('user.routes', () => { const mockErrorString = 'mock sms send error! oh no' const session = await createAuthedSession(defaultUser.email, request) const sendSmsOtpSpy = jest - .spyOn(SmsService, 'sendAdminContactOtp') + .spyOn(PostmanSmsService, 'sendAdminContactOtp') .mockReturnValueOnce(errAsync(new SmsSendError(mockErrorString))) // Act @@ -613,7 +613,7 @@ const requestForContactOtp = async ( ) => { // Set that so no real mail is sent. const sendSmsOtpSpy = jest - .spyOn(SmsService, 'sendAdminContactOtp') + .spyOn(PostmanSmsService, 'sendAdminContactOtp') .mockReturnValueOnce(okAsync(true)) // Act