PLT-7824 Added support for mentions with <@userid> and <!here> (#7615) (#7737)

Этот коммит содержится в:
Joey Lee
2017-11-18 03:17:59 +11:00
коммит произвёл Harrison Healey
родитель 065d8e9731
Коммит 3836f99920
9 изменённых файлов: 170 добавлений и 123 удалений

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

@@ -1,38 +0,0 @@
package model
import (
"testing"
)
func TestExpandAnnouncement(t *testing.T) {
if ExpandAnnouncement("<!channel> foo <!channel>") != "@channel foo @channel" {
t.Fail()
}
}
func TestProcessSlackAnnouncement(t *testing.T) {
attachments := []*SlackAttachment{
{
Pretext: "<!channel> pretext",
Text: "<!channel> text",
Title: "<!channel> title",
Fields: []*SlackAttachmentField{
{
Title: "foo",
Value: "<!channel> bar",
Short: true,
}, nil,
},
}, nil,
}
attachments = ProcessSlackAttachments(attachments)
if len(attachments) != 1 || len(attachments[0].Fields) != 1 {
t.Fail()
}
if attachments[0].Pretext != "@channel pretext" ||
attachments[0].Text != "@channel text" ||
attachments[0].Title != "@channel title" ||
attachments[0].Fields[0].Value != "@channel bar" {
t.Fail()
}
}