Skip to content

Commit

Permalink
edit swagger and fix nesting depth
Browse files Browse the repository at this point in the history
  • Loading branch information
azbcww committed Dec 3, 2023
1 parent c84387f commit d62fa79
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
4 changes: 4 additions & 0 deletions docs/v3-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4765,6 +4765,9 @@ components:
isUnicode:
type: boolean
description: Unicode絵文字か
hasThumbnail:
type: boolean
description: サムネイルの有無
required:
- id
- name
Expand All @@ -4773,6 +4776,7 @@ components:
- updatedAt
- fileId
- isUnicode
- hasThumbnail
PostStampRequest:
title: PostStampRequest
type: object
Expand Down
34 changes: 18 additions & 16 deletions repository/gorm/stamp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,30 +215,32 @@ func TestRepositoryImpl_GetAllStampsWithThumbnail(t *testing.T) {
t.Run("without thumbnail", func(t *testing.T) {
t.Parallel()
arr, err := repo.GetAllStampsWithThumbnail(repository.StampTypeAll)
if assert.NoError(err) {
assert.Len(arr, n*2)
cnt := 0
for _, s := range arr {
if !s.HasThumbnail {
cnt++
}
if !assert.NoError(err) {
t.FailNow()
}
assert.Len(arr, n*2)
cnt := 0
for _, s := range arr {
if !s.HasThumbnail {
cnt++
}
assert.Equal(n, cnt)
}
assert.Equal(n, cnt)
})
t.Run("with thumbnail", func(t *testing.T) {
t.Parallel()
arr, err := repo.GetAllStampsWithThumbnail(repository.StampTypeAll)
if assert.NoError(err) {
assert.Len(arr, n*2)
cnt := 0
for _, s := range arr {
if s.HasThumbnail {
cnt++
}
if !assert.NoError(err) {
t.FailNow()
}
assert.Len(arr, n*2)
cnt := 0
for _, s := range arr {
if s.HasThumbnail {
cnt++
}
assert.Equal(n, cnt)
}
assert.Equal(n, cnt)
})
}

Expand Down

0 comments on commit d62fa79

Please sign in to comment.