From 9461afc0bedcceb314e8127db12ca520e9dd20ef Mon Sep 17 00:00:00 2001 From: rcourtman Date: Mon, 1 Dec 2025 14:57:25 +0000 Subject: [PATCH] test: Add renderWebhookURL URL parsing error test Add test case for malformed IPv6 URL that triggers url.Parse error. Improves coverage from 90% to 95%. The remaining 5% is a template Execute error path that's effectively unreachable with current types. --- internal/notifications/notifications_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/internal/notifications/notifications_test.go b/internal/notifications/notifications_test.go index f0245f58c..6d9f691b7 100644 --- a/internal/notifications/notifications_test.go +++ b/internal/notifications/notifications_test.go @@ -562,6 +562,12 @@ func TestRenderWebhookURL_ErrorPaths(t *testing.T) { data: WebhookPayloadData{Message: "api"}, wantErr: "missing scheme or host", }, + { + name: "template renders to unparseable URL - malformed IPv6", + urlTemplate: "http://[{{.Message}}", + data: WebhookPayloadData{Message: "::1"}, + wantErr: "invalid URL", + }, } for _, tt := range tests {