Skip to content

Commit

Permalink
test: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Lifosmin Simon authored and Lifosmin Simon committed Sep 8, 2023
1 parent c655873 commit cbc0eee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions api/handler/v1beta1/grant_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,7 @@ func (s *GrpcHandlersSuite) TestListUserRoles() {
}
expectedUser := "test-user"
s.grantService.EXPECT().
ListUserRoles(mock.AnythingOfType("*context.valueCtx"), domain.ListGrantsFilter{
Owner: "test-user",
}).
ListUserRoles(mock.AnythingOfType("*context.valueCtx"), "test-user").
Return(expectedResponse.Roles, nil).Once()

ctx := context.WithValue(context.Background(), authEmailTestContextKey{}, expectedUser)
Expand Down
4 changes: 2 additions & 2 deletions core/grant/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1016,12 +1016,12 @@ func (s *ServiceTestSuite) TestGetGrantsTotalCount() {
})
}

func (s *ServiceTestSuite) TestListUserRolesCount() {
func (s *ServiceTestSuite) TestListUserRoles() {
s.Run("should return error if got error from repository", func() {
s.setup()
expectedError := errors.New("repository error")
s.mockRepository.EXPECT().
ListUserRoles(mock.AnythingOfType("*context.emptyCtx"), domain.ListGrantsFilter{}).
ListUserRoles(mock.AnythingOfType("*context.emptyCtx"), "user").
Return(nil, expectedError).Once()

actualCount, actualError := s.service.ListUserRoles(context.Background(), "user")
Expand Down

0 comments on commit cbc0eee

Please sign in to comment.