feat: add tests for webhook resolvers
This commit is contained in:
@@ -21,8 +21,10 @@ import (
|
||||
|
||||
// common user data to share across tests
|
||||
type TestData struct {
|
||||
Email string
|
||||
Password string
|
||||
Email string
|
||||
Password string
|
||||
WebhookEndpoint string
|
||||
TestEventTypes []string
|
||||
}
|
||||
|
||||
type TestSetup struct {
|
||||
@@ -75,8 +77,10 @@ func createContext(s TestSetup) (*http.Request, context.Context) {
|
||||
|
||||
func testSetup() TestSetup {
|
||||
testData := TestData{
|
||||
Email: fmt.Sprintf("%d_authorizer_tester@yopmail.com", time.Now().Unix()),
|
||||
Password: "Test@123",
|
||||
Email: fmt.Sprintf("%d_authorizer_tester@yopmail.com", time.Now().Unix()),
|
||||
Password: "Test@123",
|
||||
WebhookEndpoint: "https://62cbc6738042b16aa7c22df2.mockapi.io/api/v1/webhook",
|
||||
TestEventTypes: []string{constants.UserAccessEnabledWebhookEvent, constants.UserAccessRevokedWebhookEvent, constants.UserCreatedWebhookEvent, constants.UserDeletedWebhookEvent, constants.UserLoginWebhookEvent, constants.UserSignUpWebhookEvent},
|
||||
}
|
||||
|
||||
err := os.Setenv(constants.EnvKeyEnvPath, "../../.env.test")
|
||||
|
Reference in New Issue
Block a user