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