Skip to content

Commit

Permalink
fix(btn): form admin not fully resolved when retrieved from FormServi…
Browse files Browse the repository at this point in the history
…ce (#7420)

* fix: form admin not fully resolved when retrieved from FormService

* fix: update test cases to include new mocked function
  • Loading branch information
KenLSM authored Jun 20, 2024
1 parent 65cb0d4 commit fefa741
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { SmsFactory } from 'src/app/services/sms/sms.factory'
import * as HashUtils from 'src/app/utils/hash'
import {
IFormSchema,
IPopulatedForm,
IUserSchema,
IVerificationSchema,
UpdateFieldData,
Expand Down Expand Up @@ -318,6 +319,9 @@ describe('Verification service', () => {
.spyOn(VerificationModel, 'updateHashForField')
.mockResolvedValue(mockTransactionSuccessful)
MockFormService.retrieveFormById.mockReturnValue(okAsync(mockForm))
MockFormService.retrieveFullFormById.mockReturnValue(
okAsync(mockForm as IPopulatedForm),
)

jest
.spyOn(AdminFormUtils, 'verifyUserBetaflag')
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/verification/verification.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ const sendOtpForField = (
switch (fieldType) {
case BasicField.Mobile:
return fieldId
? FormService.retrieveFormById(formId)
? FormService.retrieveFullFormById(formId)
// check if we should allow public user to request for otp
.andThen((form) => {
return okAsync(form)
Expand Down

0 comments on commit fefa741

Please sign in to comment.