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
@@ -70,9 +70,8 @@ func TestCreateCommandPost(t *testing.T) {
|
||||
|
||||
skipSlackParsing := false
|
||||
_, err := th.App.CreateCommandPost(post, th.BasicTeam.Id, resp, skipSlackParsing)
|
||||
if err == nil || err.Id != "api.context.invalid_param.app_error" {
|
||||
t.Fatal("should have failed - bad post type")
|
||||
}
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, err.Id, "api.context.invalid_param.app_error")
|
||||
}
|
||||
|
||||
func TestHandleCommandResponsePost(t *testing.T) {
|
||||
@@ -208,9 +207,8 @@ func TestHandleCommandResponsePost(t *testing.T) {
|
||||
args.UserId = th.BasicUser2.Id
|
||||
post, err = th.App.HandleCommandResponsePost(command, args, resp, builtIn)
|
||||
|
||||
if err == nil || err.Id != "api.command.command_post.forbidden.app_error" {
|
||||
t.Fatal("should have failed - forbidden channel post")
|
||||
}
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, err.Id, "api.command.command_post.forbidden.app_error")
|
||||
|
||||
// Test that /code text is not converted with the Slack text conversion.
|
||||
command.Trigger = "code"
|
||||
@@ -252,9 +250,8 @@ func TestHandleCommandResponse(t *testing.T) {
|
||||
builtIn := true
|
||||
|
||||
_, err := th.App.HandleCommandResponse(command, args, resp, builtIn)
|
||||
if err == nil || err.Id != "api.command.execute_command.create_post_failed.app_error" {
|
||||
t.Fatal("should have failed - invalid post type")
|
||||
}
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, err.Id, "api.command.execute_command.create_post_failed.app_error")
|
||||
|
||||
resp = &model.CommandResponse{
|
||||
Text: "message 1",
|
||||
@@ -277,9 +274,8 @@ func TestHandleCommandResponse(t *testing.T) {
|
||||
}
|
||||
|
||||
_, err = th.App.HandleCommandResponse(command, args, resp, builtIn)
|
||||
if err == nil || err.Id != "api.command.execute_command.create_post_failed.app_error" {
|
||||
t.Fatal("should have failed - invalid post type on extra response")
|
||||
}
|
||||
require.NotNil(t, err)
|
||||
require.Equal(t, err.Id, "api.command.execute_command.create_post_failed.app_error")
|
||||
|
||||
resp = &model.CommandResponse{
|
||||
ExtraResponses: []*model.CommandResponse{
|
||||
|
||||
Ссылка в новой задаче
Block a user