MCPcopy Create free account
hub / github.com/bytebase/bytebase / TestBuildMessage_NoLink

Function TestBuildMessage_NoLink

backend/plugin/webhook/slack/slack_test.go:99–119  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

97}
98
99func TestBuildMessage_NoLink(t *testing.T) {
100 a := require.New(t)
101
102 ctx := webhook.Context{
103 Level: webhook.WebhookInfo,
104 Title: "Issue created",
105 }
106
107 msg := BuildMessage(ctx)
108
109 a.Equal("#1264A3", msg.Attachments[0].Color)
110 blocks := msg.Attachments[0].BlockList
111
112 // Title should NOT be linked
113 a.NotContains(blocks[0].Text.Text, "<")
114
115 // No actions block when no link
116 for _, b := range blocks {
117 a.NotEqual("actions", b.Type)
118 }
119}
120
121func TestBuildMessage_Warn(t *testing.T) {
122 a := require.New(t)

Callers

nothing calls this directly

Calls 2

BuildMessageFunction · 0.70
EqualMethod · 0.65

Tested by

no test coverage detected