fix: refs for db provider and few utils
This commit is contained in:
@@ -24,7 +24,7 @@ func deleteEmailTemplateTest(t *testing.T, s TestSetup) {
|
||||
req.Header.Set("Cookie", fmt.Sprintf("%s=%s", constants.AdminCookieName, h))
|
||||
|
||||
// get all email templates
|
||||
emailTemplates, err := db.Provider.ListEmailTemplate(ctx, model.Pagination{
|
||||
emailTemplates, err := db.Provider.ListEmailTemplate(ctx, &model.Pagination{
|
||||
Limit: 10,
|
||||
Page: 1,
|
||||
Offset: 0,
|
||||
@@ -41,7 +41,7 @@ func deleteEmailTemplateTest(t *testing.T, s TestSetup) {
|
||||
assert.NotEmpty(t, res.Message)
|
||||
}
|
||||
|
||||
emailTemplates, err = db.Provider.ListEmailTemplate(ctx, model.Pagination{
|
||||
emailTemplates, err = db.Provider.ListEmailTemplate(ctx, &model.Pagination{
|
||||
Limit: 10,
|
||||
Page: 1,
|
||||
Offset: 0,
|
||||
|
@@ -24,7 +24,7 @@ func deleteWebhookTest(t *testing.T, s TestSetup) {
|
||||
req.Header.Set("Cookie", fmt.Sprintf("%s=%s", constants.AdminCookieName, h))
|
||||
|
||||
// get all webhooks
|
||||
webhooks, err := db.Provider.ListWebhook(ctx, model.Pagination{
|
||||
webhooks, err := db.Provider.ListWebhook(ctx, &model.Pagination{
|
||||
Limit: 20,
|
||||
Page: 1,
|
||||
Offset: 0,
|
||||
@@ -41,14 +41,14 @@ func deleteWebhookTest(t *testing.T, s TestSetup) {
|
||||
assert.NotEmpty(t, res.Message)
|
||||
}
|
||||
|
||||
webhooks, err = db.Provider.ListWebhook(ctx, model.Pagination{
|
||||
webhooks, err = db.Provider.ListWebhook(ctx, &model.Pagination{
|
||||
Limit: 20,
|
||||
Page: 1,
|
||||
Offset: 0,
|
||||
})
|
||||
assert.NoError(t, err)
|
||||
assert.Len(t, webhooks.Webhooks, 0)
|
||||
webhookLogs, err := db.Provider.ListWebhookLogs(ctx, model.Pagination{
|
||||
webhookLogs, err := db.Provider.ListWebhookLogs(ctx, &model.Pagination{
|
||||
Limit: 100,
|
||||
Page: 1,
|
||||
Offset: 0,
|
||||
|
@@ -18,7 +18,7 @@ func updateAllUsersTest(t *testing.T, s TestSetup) {
|
||||
t.Run("Should update all users", func(t *testing.T) {
|
||||
_, ctx := createContext(s)
|
||||
for i := 0; i < 10; i++ {
|
||||
user := models.User{
|
||||
user := &models.User{
|
||||
Email: fmt.Sprintf("update_all_user_%d_%s", i, s.TestInfo.Email),
|
||||
SignupMethods: constants.AuthRecipeMethodBasicAuth,
|
||||
Roles: "user",
|
||||
@@ -33,7 +33,7 @@ func updateAllUsersTest(t *testing.T, s TestSetup) {
|
||||
}, nil)
|
||||
assert.NoError(t, err)
|
||||
|
||||
listUsers, err := db.Provider.ListUsers(ctx, model.Pagination{
|
||||
listUsers, err := db.Provider.ListUsers(ctx, &model.Pagination{
|
||||
Limit: 20,
|
||||
Offset: 0,
|
||||
})
|
||||
@@ -49,7 +49,7 @@ func updateAllUsersTest(t *testing.T, s TestSetup) {
|
||||
}, updateIds)
|
||||
assert.NoError(t, err)
|
||||
|
||||
listUsers, err = db.Provider.ListUsers(ctx, model.Pagination{
|
||||
listUsers, err = db.Provider.ListUsers(ctx, &model.Pagination{
|
||||
Limit: 20,
|
||||
Offset: 0,
|
||||
})
|
||||
|
@@ -39,7 +39,7 @@ func validateJwtTokenTest(t *testing.T, s TestSetup) {
|
||||
})
|
||||
|
||||
scope := []string{"openid", "email", "profile", "offline_access"}
|
||||
user := models.User{
|
||||
user := &models.User{
|
||||
ID: uuid.New().String(),
|
||||
Email: "jwt_test_" + s.TestInfo.Email,
|
||||
Roles: "user",
|
||||
|
Reference in New Issue
Block a user