Files
authorizer/server/test/resend_verify_email_test.go

33 lines
949 B
Go
Raw Normal View History

package test
import (
"testing"
2022-01-17 11:32:13 +05:30
"github.com/authorizerdev/authorizer/server/constants"
"github.com/authorizerdev/authorizer/server/graph/model"
"github.com/authorizerdev/authorizer/server/refs"
"github.com/authorizerdev/authorizer/server/resolvers"
"github.com/stretchr/testify/assert"
)
2022-01-17 11:32:13 +05:30
func resendVerifyEmailTests(t *testing.T, s TestSetup) {
t.Helper()
2021-12-24 06:27:39 +05:30
t.Run(`should resend verification email`, func(t *testing.T) {
_, ctx := createContext(s)
email := "resend_verify_email." + s.TestInfo.Email
2022-01-17 11:32:13 +05:30
_, err := resolvers.SignupResolver(ctx, model.SignUpInput{
Email: refs.NewStringRef(email),
2021-12-24 06:27:39 +05:30
Password: s.TestInfo.Password,
ConfirmPassword: s.TestInfo.Password,
})
assert.NoError(t, err)
2022-01-17 11:32:13 +05:30
_, err = resolvers.ResendVerifyEmailResolver(ctx, model.ResendVerifyEmailInput{
2021-12-24 06:27:39 +05:30
Email: email,
2022-01-17 11:32:13 +05:30
Identifier: constants.VerificationTypeBasicAuthSignup,
2021-12-24 06:27:39 +05:30
})
assert.NoError(t, err)
2021-12-24 06:27:39 +05:30
cleanData(email)
})
}