Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
azbcww committed Oct 18, 2023
1 parent ad78889 commit 9efe74c
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions repository/gorm/stamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,14 @@ func TestRepositoryImpl_GetAllStamps(t *testing.T) {
repo, assert, _ := setup(t, ex1)

n := 10
for i := 0; i < 10; i++ {
mustMakeStamp(t, repo, rand, uuid.Nil)
arr, err := repo.GetAllStamps(repository.StampTypeAll)
if len(arr) == 0 {
for i := 0; i < 10; i++ {
mustMakeStamp(t, repo, rand, uuid.Nil)
}
arr, err = repo.GetAllStamps(repository.StampTypeAll)
}

arr, err := repo.GetAllStamps(repository.StampTypeAll)
if assert.NoError(err) {
assert.Len(arr, n)
}
Expand Down Expand Up @@ -370,11 +373,15 @@ func TestRepositoryImpl_StampThumbnailExists(t *testing.T) {
repo, assert, _ := setup(t, ex1)

n := 10
for i := 0; i < 10; i++ {
mustMakeStamp(t, repo, rand, uuid.Nil)
}

arr, err := repo.GetAllStamps(repository.StampTypeAll)
if len(arr) == 0 {
for i := 0; i < 10; i++ {
mustMakeStamp(t, repo, rand, uuid.Nil)
}
arr, err = repo.GetAllStamps(repository.StampTypeAll)
}

if assert.NoError(err) {
assert.Len(arr, n)
}
Expand Down

0 comments on commit 9efe74c

Please sign in to comment.