(t *testing.T)
| 97 | } |
| 98 | |
| 99 | func 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 | |
| 121 | func TestBuildMessage_Warn(t *testing.T) { |
| 122 | a := require.New(t) |
nothing calls this directly
no test coverage detected