Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmagnus committed Dec 6, 2023
1 parent 1d949c3 commit 9f97b83
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 8 deletions.
67 changes: 63 additions & 4 deletions backend/internal/usecase/mocks/mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions backend/internal/usecase/vault_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func TestVaultUseCaseList(t *testing.T) {
name: "list - two vaults",
req: nil,
mock: func() {
vr.EXPECT().GetVaults().Return([]entity.Vault{vault1, vault2}, nil)
vr.EXPECT().GetVaults(true).Return([]entity.Vault{vault1, vault2}, nil)
},
res: []entity.Vault{vault1, vault2},
err: nil,
Expand All @@ -77,7 +77,7 @@ func TestVaultUseCaseList(t *testing.T) {
name: "list - empty",
req: nil,
mock: func() {
vr.EXPECT().GetVaults().Return([]entity.Vault{}, nil)
vr.EXPECT().GetVaults(true).Return([]entity.Vault{}, nil)
},
res: []entity.Vault{},
err: nil,
Expand All @@ -86,7 +86,7 @@ func TestVaultUseCaseList(t *testing.T) {
name: "list - database error",
req: nil,
mock: func() {
vr.EXPECT().GetVaults().Return(nil, dbError)
vr.EXPECT().GetVaults(true).Return(nil, dbError)
},
res: []entity.Vault(nil),
err: dbError,
Expand All @@ -98,7 +98,7 @@ func TestVaultUseCaseList(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
tc.mock()

res, err := u.GetAll()
res, err := u.GetAll(true)

require.EqualValues(t, tc.res, res)
if tc.err == nil {
Expand Down

0 comments on commit 9f97b83

Please sign in to comment.