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.
This commit is contained in:
rcourtman 2025-12-01 14:57:25 +00:00
parent e774feb8ba
commit 9461afc0be

View file

@ -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 {