Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
yk-eukarya committed Oct 17, 2023
1 parent eb3a10a commit 88c301c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions account/accountinfrastructure/accountmemory/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,10 @@ func TestUser_FindByPasswordResetRequest(t *testing.T) {
mockErr bool
}{
{
name: "must find user by password reset",
seeds: []*user.User{u},
token: "123abc",
want: u,
wantErr: rerror.ErrNotFound,
name: "must find user by password reset",
seeds: []*user.User{u},
token: "123abc",
want: u,
},
{
name: "must return ErrInvalidParams",
Expand All @@ -261,12 +260,14 @@ func TestUser_FindByPasswordResetRequest(t *testing.T) {
t.Run(tc.name, func(tt *testing.T) {
tt.Parallel()

r := &User{}
r := &User{
data: &util.SyncMap[accountdomain.UserID, *user.User]{},
}
if tc.mockErr {
SetUserError(r, tc.wantErr)
}
for _, u := range tc.seeds {
_ = r.Save(ctx, u.Clone())
for _, uu := range tc.seeds {
_ = r.Save(ctx, uu.Clone())
}
got, err := r.FindByPasswordResetRequest(ctx, tc.token)
if tc.wantErr != nil {
Expand Down

0 comments on commit 88c301c

Please sign in to comment.