From d62fa7962532a8f0d29a57d5dd7d81d213490df6 Mon Sep 17 00:00:00 2001 From: azbcww <1121hatsuyuki@gmail.com> Date: Sun, 3 Dec 2023 15:34:29 +0900 Subject: [PATCH] edit swagger and fix nesting depth --- docs/v3-api.yaml | 4 ++++ repository/gorm/stamp_test.go | 34 ++++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/docs/v3-api.yaml b/docs/v3-api.yaml index 12fbb3aeb..19f880188 100644 --- a/docs/v3-api.yaml +++ b/docs/v3-api.yaml @@ -4765,6 +4765,9 @@ components: isUnicode: type: boolean description: Unicode絵文字か + hasThumbnail: + type: boolean + description: サムネイルの有無 required: - id - name @@ -4773,6 +4776,7 @@ components: - updatedAt - fileId - isUnicode + - hasThumbnail PostStampRequest: title: PostStampRequest type: object diff --git a/repository/gorm/stamp_test.go b/repository/gorm/stamp_test.go index 2a7614713..88b03ed66 100644 --- a/repository/gorm/stamp_test.go +++ b/repository/gorm/stamp_test.go @@ -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) }) }