From c4f32ff505dd3a58022d082d689f872ba09f2e89 Mon Sep 17 00:00:00 2001 From: Femi Novia Lina Date: Tue, 16 Apr 2024 15:17:54 +0700 Subject: [PATCH] feat: add test for coverage --- internal/store/postgres/action_repository_test.go | 8 ++++++++ internal/store/postgres/project_repository_test.go | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/internal/store/postgres/action_repository_test.go b/internal/store/postgres/action_repository_test.go index 19ff8dfbe..e8c4dcdd4 100644 --- a/internal/store/postgres/action_repository_test.go +++ b/internal/store/postgres/action_repository_test.go @@ -260,6 +260,14 @@ func (s *ActionRepositoryTestSuite) TestUpdate() { Description: "should return error if action id is empty", ErrString: "action id is invalid", }, + { + Description: "should return error if action name is empty", + ActionToUpdate: action.Action{ + ID: "action2", + Name: "", + }, + ErrString: action.ErrInvalidDetail.Error(), + }, } for _, tc := range testCases { diff --git a/internal/store/postgres/project_repository_test.go b/internal/store/postgres/project_repository_test.go index e891d76fe..1873a8fcb 100644 --- a/internal/store/postgres/project_repository_test.go +++ b/internal/store/postgres/project_repository_test.go @@ -564,6 +564,17 @@ func (s *ProjectRepositoryTestSuite) TestUpdateBySlug() { Description: "should return error if project slug is empty", ErrString: project.ErrInvalidID.Error(), }, + { + Description: "should return error if project name is empty", + ProjectToUpdate: project.Project{ + Slug: "project-1", + Name: "", + Organization: organization.Organization{ + ID: s.orgs[0].ID, + }, + }, + ErrString: project.ErrInvalidDetail.Error(), + }, } for _, tc := range testCases {