Skip to content

Commit

Permalink
update sms error import path
Browse files Browse the repository at this point in the history
  • Loading branch information
KenLSM committed Jun 4, 2024
1 parent d6a822d commit d6f72a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 5 additions & 5 deletions src/app/routes/api/v3/user/__tests__/user.routes.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d6f72a9

Please sign in to comment.