fix(alerting): Resolve Telegram issue with bad payload when condition has `"` in it
@@ -147,11 +147,11 @@ func TestAlertProvider_buildRequestBody(t *testing.T) {
},
scenario.Resolved,
)
- if body != scenario.ExpectedBody {
- t.Errorf("expected %s, got %s", scenario.ExpectedBody, body)
+ if string(body) != scenario.ExpectedBody {
+ t.Errorf("expected:\n%s\ngot:\n%s", scenario.ExpectedBody, body)
}
out := make(map[string]interface{})
- if err := json.Unmarshal([]byte(body), &out); err != nil {
+ if err := json.Unmarshal(body, &out); err != nil {
t.Error("expected body to be valid JSON, got error:", err.Error())
}
})
