mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-09-21 02:33:32 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user