diff --git a/server/.golangci.yml b/server/.golangci.yml index 51308a83793..5ab81eee5c7 100644 --- a/server/.golangci.yml +++ b/server/.golangci.yml @@ -83,7 +83,6 @@ issues: channels/api4/team_test.go|\ channels/api4/user_test.go|\ channels/api4/websocket_test.go|\ - channels/app/auto_responder_test.go|\ channels/app/bot_test.go|\ channels/app/brand.go|\ channels/app/channel.go|\ diff --git a/server/channels/app/auto_responder_test.go b/server/channels/app/auto_responder_test.go index 74fcbaa77c6..7cc93541af3 100644 --- a/server/channels/app/auto_responder_test.go +++ b/server/channels/app/auto_responder_test.go @@ -18,7 +18,10 @@ func TestSetAutoResponderStatus(t *testing.T) { defer th.TearDown() user := th.CreateUser() - defer th.App.PermanentDeleteUser(th.Context, user) + defer func() { + err := th.App.PermanentDeleteUser(th.Context, user) + require.Nil(t, err) + }() th.App.SetStatusOnline(user.Id, true) @@ -56,7 +59,10 @@ func TestDisableAutoResponder(t *testing.T) { defer th.TearDown() user := th.CreateUser() - defer th.App.PermanentDeleteUser(th.Context, user) + defer func() { + err := th.App.PermanentDeleteUser(th.Context, user) + require.Nil(t, err) + }() th.App.SetStatusOnline(user.Id, true) @@ -65,17 +71,20 @@ func TestDisableAutoResponder(t *testing.T) { patch.NotifyProps["auto_responder_active"] = "true" patch.NotifyProps["auto_responder_message"] = "Hello, I'm unavailable today." - th.App.PatchUser(th.Context, user.Id, patch, true) + user, appErr := th.App.PatchUser(th.Context, user.Id, patch, true) + require.Nil(t, appErr) - th.App.DisableAutoResponder(th.Context, user.Id, true) + err := th.App.DisableAutoResponder(th.Context, user.Id, true) + require.Nil(t, err) userUpdated1, err := th.App.GetUser(user.Id) require.Nil(t, err) assert.Equal(t, userUpdated1.NotifyProps["auto_responder_active"], "false") - th.App.DisableAutoResponder(th.Context, user.Id, true) - + err = th.App.DisableAutoResponder(th.Context, user.Id, true) + require.Nil(t, err) userUpdated2, err := th.App.GetUser(user.Id) + require.Nil(t, err) assert.Equal(t, userUpdated2.NotifyProps["auto_responder_active"], "false") } @@ -244,7 +253,10 @@ func TestSendAutoResponseSuccess(t *testing.T) { defer th.TearDown() user := th.CreateUser() - defer th.App.PermanentDeleteUser(th.Context, user) + defer func() { + err := th.App.PermanentDeleteUser(th.Context, user) + require.Nil(t, err) + }() patch := &model.UserPatch{} patch.NotifyProps = make(map[string]string) @@ -284,7 +296,10 @@ func TestSendAutoResponseSuccessOnThread(t *testing.T) { defer th.TearDown() user := th.CreateUser() - defer th.App.PermanentDeleteUser(th.Context, user) + defer func() { + err := th.App.PermanentDeleteUser(th.Context, user) + require.Nil(t, err) + }() patch := &model.UserPatch{} patch.NotifyProps = make(map[string]string) @@ -333,7 +348,10 @@ func TestSendAutoResponseFailure(t *testing.T) { defer th.TearDown() user := th.CreateUser() - defer th.App.PermanentDeleteUser(th.Context, user) + defer func() { + err := th.App.PermanentDeleteUser(th.Context, user) + require.Nil(t, err) + }() patch := &model.UserPatch{} patch.NotifyProps = make(map[string]string)