# Conflicts: # server/channels/app/slack.go Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
7526844c50
Коммит
667dffe31d
@@ -6,6 +6,8 @@ package app
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mattermost/mattermost/server/public/model"
|
||||
)
|
||||
|
||||
@@ -33,6 +35,31 @@ func TestProcessSlackText(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestProcessMessageAttachmentsWithNilEntries(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
defer th.TearDown()
|
||||
|
||||
attachments := []*model.SlackAttachment{
|
||||
nil,
|
||||
{
|
||||
Pretext: "pretext",
|
||||
Text: "text",
|
||||
Title: "title",
|
||||
},
|
||||
nil,
|
||||
{
|
||||
Pretext: "pretext2",
|
||||
Text: "text2",
|
||||
},
|
||||
}
|
||||
|
||||
result := th.App.ProcessSlackAttachments(attachments)
|
||||
require.Len(t, result, 2)
|
||||
require.Equal(t, "pretext", result[0].Pretext)
|
||||
require.Equal(t, "pretext2", result[1].Pretext)
|
||||
}
|
||||
|
||||
func TestProcessSlackAnnouncement(t *testing.T) {
|
||||
mainHelper.Parallel(t)
|
||||
th := Setup(t).InitBasic()
|
||||
|
||||
Ссылка в новой задаче
Block a user