Skip to content

Commit

Permalink
WIP: fix mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
taratatach committed Nov 18, 2024
1 parent 8b1d02c commit a117c9c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions model/cloudery/service_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ func (m *Mock) LegalNoticeUrl(inst *instance.Instance) (string, error) {
args := m.Called(inst)

if args.Get(0) == nil {
return "", args.Error(1)
return "", args.Error(0)
}

return args.Get(0).(string), args.Error(1)
return args.Get(0).(string), nil
}
4 changes: 2 additions & 2 deletions model/settings/service_mock.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ func (m *Mock) GetLegalNoticeUrl(inst *instance.Instance) (string, error) {
args := m.Called(inst)

if args.Get(0) == nil {
return "", args.Error(1)
return "", args.Error(0)
}

return args.Get(0).(string), args.Error(1)
return args.Get(0).(string), nil
}
2 changes: 1 addition & 1 deletion web/settings/settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ func TestSettings(t *testing.T) {

t.Run("GetInstance", func(t *testing.T) {
e := testutils.CreateTestClient(t, tsURL)
svc.On("GetLegalNoticeUrl", testInstance).Return("https://testmanager.cozycloud.cc/tos/12345.pdf").Times(3)
svc.On("GetLegalNoticeUrl", testInstance).Return("https://testmanager.cozycloud.cc/tos/12345.pdf").Once()

e.GET("/settings/instance").
WithCookie(sessCookie, "connected").
Expand Down

0 comments on commit a117c9c

Please sign in to comment.