25 lines
817 B
Go
25 lines
817 B
Go
package dingtalk
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"gitea.zheromiku.top/Weknora/dobotai-platform/internal/coverage"
|
|
)
|
|
|
|
func TestSupportGroupSenderRendersFeedbackDownTrigger(t *testing.T) {
|
|
notification := newTestNotification()
|
|
notification.TriggerType = coverage.SupportTriggerFeedbackDown
|
|
title, text := (&SupportGroupSender{}).renderMarkdown(notification)
|
|
if title != "回答被点踩提醒" || !strings.Contains(text, "【回答被点踩提醒】") {
|
|
t.Fatalf("title=%q text=%q", title, text)
|
|
}
|
|
}
|
|
|
|
func TestSupportGroupSenderDefaultsHistoricalTriggerToCoverage(t *testing.T) {
|
|
title, text := (&SupportGroupSender{}).renderMarkdown(newTestNotification())
|
|
if title != "知识库未覆盖提醒" || !strings.Contains(text, "【知识库未覆盖提醒】") {
|
|
t.Fatalf("title=%q text=%q", title, text)
|
|
}
|
|
}
|