Update tests

This commit is contained in:
Lakhan Samani
2024-04-02 15:25:11 +05:30
parent 67f866a787
commit 28b574c827
51 changed files with 275 additions and 143 deletions

View File

@@ -28,7 +28,7 @@ func (p *provider) AddAuthenticator(ctx context.Context, authenticators *models.
authenticatorsCollection, _ := p.db.Collection(ctx, models.Collections.Authenticators)
meta, err := authenticatorsCollection.CreateDocument(arangoDriver.WithOverwrite(ctx), authenticators)
if err != nil {
return authenticators, err
return nil, err
}
authenticators.Key = meta.Key
authenticators.ID = meta.ID.String()
@@ -42,7 +42,7 @@ func (p *provider) UpdateAuthenticator(ctx context.Context, authenticators *mode
collection, _ := p.db.Collection(ctx, models.Collections.Authenticators)
meta, err := collection.UpdateDocument(ctx, authenticators.Key, authenticators)
if err != nil {
return authenticators, err
return nil, err
}
authenticators.Key = meta.Key
@@ -59,7 +59,7 @@ func (p *provider) GetAuthenticatorDetailsByUserId(ctx context.Context, userId s
}
cursor, err := p.db.Query(ctx, query, bindVars)
if err != nil {
return authenticators, err
return nil, err
}
defer cursor.Close()
for {
@@ -71,7 +71,7 @@ func (p *provider) GetAuthenticatorDetailsByUserId(ctx context.Context, userId s
}
_, err := cursor.ReadDocument(ctx, &authenticators)
if err != nil {
return authenticators, err
return nil, err
}
}
return authenticators, nil