Update resend otp

This commit is contained in:
Lakhan Samani
2023-07-23 10:03:37 +05:30
parent fac333e195
commit 55fc4b2608
20 changed files with 162 additions and 130 deletions

View File

@@ -51,7 +51,7 @@ func resendOTPTest(t *testing.T, s TestSetup) {
assert.NotNil(t, updateRes)
// Resend otp should return error as no initial opt is being sent
resendOtpRes, err := resolvers.ResendOTPResolver(ctx, model.ResendOTPRequest{
Email: email,
Email: refs.NewStringRef(email),
})
assert.Error(t, err)
assert.Nil(t, resendOtpRes)
@@ -72,7 +72,7 @@ func resendOTPTest(t *testing.T, s TestSetup) {
// resend otp
resendOtpRes, err = resolvers.ResendOTPResolver(ctx, model.ResendOTPRequest{
Email: email,
Email: refs.NewStringRef(email),
})
assert.NoError(t, err)
assert.NotEmpty(t, resendOtpRes.Message)

View File

@@ -126,6 +126,10 @@ func testSetup() TestSetup {
memorystore.Provider.UpdateEnvVariable(constants.EnvKeySmtpPassword, "test")
memorystore.Provider.UpdateEnvVariable(constants.EnvKeySenderEmail, "info@yopmail.com")
memorystore.Provider.UpdateEnvVariable(constants.EnvKeyProtectedRoles, "admin")
memorystore.Provider.UpdateEnvVariable(constants.EnvKeyTwilioAPIKey, "test")
memorystore.Provider.UpdateEnvVariable(constants.EnvKeyTwilioAPISecret, "test")
memorystore.Provider.UpdateEnvVariable(constants.EnvKeyTwilioAccountSID, "test")
memorystore.Provider.UpdateEnvVariable(constants.EnvKeyTwilioSender, "1234567890")
err = db.InitDB()
if err != nil {