mirror of
https://github.com/mattermost/mattermost.git
synced 2026-05-28 04:35:04 -04:00
Fixed errcheck isssues in Auto_responder_test.go (#28987)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
This commit is contained in:
parent
faa6853a28
commit
f377399c4c
2 changed files with 27 additions and 10 deletions
|
|
@ -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|\
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue