Remove remaining t.Fatal from the codebase (#13876)
* Remove remaining t.Fatal from the codebase * Fix job_store test * Address review comments * Remove comments
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
17523fa5d9
Коммит
84f45634a8
@@ -405,7 +405,7 @@ func TestAddUserToChannelCreatesChannelMemberHistoryRecord(t *testing.T) {
|
||||
|
||||
// the user leaves that channel
|
||||
if err := th.App.LeaveChannel(publicChannel.Id, th.BasicUser.Id); err != nil {
|
||||
t.Fatal("Failed to remove user from channel. Error: " + err.Message)
|
||||
require.Fail(t, "Failed to remove user from channel. Error: " + err.Message)
|
||||
}
|
||||
histories = store.Must(th.App.Srv().Store.ChannelMemberHistory().GetUsersInChannelDuring(model.GetMillis()-100, model.GetMillis()+100, publicChannel.Id)).([]*model.ChannelMemberHistoryResult)
|
||||
assert.Len(t, histories, 1)
|
||||
@@ -477,9 +477,8 @@ func TestAddChannelMemberNoUserRequestor(t *testing.T) {
|
||||
|
||||
// create a user and add it to a channel
|
||||
user := th.CreateUser()
|
||||
if _, err := th.App.AddTeamMember(th.BasicTeam.Id, user.Id); err != nil {
|
||||
t.Fatal("Failed to add user to team. Error: " + err.Message)
|
||||
}
|
||||
_, err := th.App.AddTeamMember(th.BasicTeam.Id, user.Id)
|
||||
require.Nil(t, err)
|
||||
|
||||
groupUserIds := make([]string, 0)
|
||||
groupUserIds = append(groupUserIds, th.BasicUser.Id)
|
||||
@@ -488,7 +487,7 @@ func TestAddChannelMemberNoUserRequestor(t *testing.T) {
|
||||
channel := th.createChannel(th.BasicTeam, model.CHANNEL_OPEN)
|
||||
userRequestorId := ""
|
||||
postRootId := ""
|
||||
_, err := th.App.AddChannelMember(user.Id, channel, userRequestorId, postRootId)
|
||||
_, err = th.App.AddChannelMember(user.Id, channel, userRequestorId, postRootId)
|
||||
require.Nil(t, err, "Failed to add user to channel.")
|
||||
|
||||
// there should be a ChannelMemberHistory record for the user
|
||||
|
||||
Ссылка в новой задаче
Block a user