Automatic Merge
Этот коммит содержится в:
Guillermo Vayá
2026-03-20 12:30:54 +01:00
коммит произвёл GitHub
родитель 8ef7f78d8d
Коммит 532f2882d1
10 изменённых файлов: 413 добавлений и 18 удалений

Просмотреть файл

@@ -2247,6 +2247,23 @@ func TestPluginAPIUpdateCommand(t *testing.T) {
require.NoError(t, appErr)
require.Equal(t, "anothernewtriggeragain", newCmd4.Trigger)
require.Equal(t, team1.Id, newCmd4.TeamId)
// Updating a command's trigger to one that already exists should fail.
cmd2 := &model.Command{
TeamId: team1.Id,
Trigger: "uniquetrigger",
Method: "G",
URL: "http://test.com/uniquetrigger",
}
cmd2, appErr = api.CreateCommand(cmd2)
require.NoError(t, appErr)
cmd2.Trigger = "anotherNewTriggerAgain"
_, appErr = api.UpdateCommand(cmd2.Id, cmd2)
require.Error(t, appErr)
var appError *model.AppError
require.ErrorAs(t, appErr, &appError)
require.Equal(t, "api.command.duplicate_trigger.app_error", appError.Id)
}
func TestPluginAPIIsEnterpriseReady(t *testing.T) {