feat(alerting): Added the ability to send messages to Telegram topics in groups.

fix tests
This commit is contained in:
kde 2025-01-18 10:33:47 +03:00
parent cade136598
commit 9f60d47d46

View File

@ -156,7 +156,7 @@ func TestAlertProvider_buildRequestBody(t *testing.T) {
},
{
Name: "send to topic",
Provider: AlertProvider{ID: "123", TopicId: "7"},
Provider: AlertProvider{DefaultConfig: Config{ID: "123", TopicId: "7"}},
Alert: alert.Alert{Description: &firstDescription, SuccessThreshold: 5, FailureThreshold: 3},
Resolved: false,
ExpectedBody: "{\"chat_id\":\"123\",\"text\":\"⛑ *Gatus* \\nAn alert for *endpoint-name* has been triggered:\\n—\\n _healthcheck failed 3 time(s) in a row_\\n— \\n*Description* \\n_description-1_ \\n\\n*Condition results*\\n❌ - `[CONNECTED] == true`\\n❌ - `[STATUS] == 200`\\n\",\"parse_mode\":\"MARKDOWN\",\"message_thread_id\":\"7\"}",