Skip to content

Commit

Permalink
test追加
Browse files Browse the repository at this point in the history
  • Loading branch information
azbcww committed Oct 18, 2023
1 parent 6fde0ca commit e3d6c7c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
21 changes: 21 additions & 0 deletions repository/gorm/stamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,3 +364,24 @@ func TestGormRepository_GetStampStats(t *testing.T) {
})

}


func TestRepositoryImpl_StampThumbnailExists(t *testing.T) {
t.Parallel()
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 assert.NoError(err) {
assert.Len(arr, n)
}

arrWithThumb, err := repo.StampThumbnailExists(arr)
if assert.NoError(err) {
assert.Len(arrWithThumb, n)
}
}
3 changes: 3 additions & 0 deletions router/v3/stamps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func TestHandlers_GetStamps(t *testing.T) {

obj.Length().IsEqual(1)
stampEquals(t, stamp, obj.Value(0).Object())
obj.Value(0).Object().Value("HasThumbnail").Boolean().IsEqual(false)
})

t.Run("success (type=original)", func(t *testing.T) {
Expand All @@ -101,6 +102,7 @@ func TestHandlers_GetStamps(t *testing.T) {

obj.Length().IsEqual(1)
stampEquals(t, stamp, obj.Value(0).Object())
obj.Value(0).Object().Value("HasThumbnail").Boolean().IsEqual(false)
})

t.Run("success (type=unicode)", func(t *testing.T) {
Expand Down Expand Up @@ -130,6 +132,7 @@ func TestHandlers_GetStamps(t *testing.T) {

obj.Length().IsEqual(1)
stampEquals(t, stamp, obj.Value(0).Object())
obj.Value(0).Object().Value("HasThumbnail").Boolean().IsEqual(false)
})
}

Expand Down

0 comments on commit e3d6c7c

Please sign in to comment.