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:
parent
e774feb8ba
commit
9461afc0be
1 changed files with 6 additions and 0 deletions
|
|
@ -562,6 +562,12 @@ func TestRenderWebhookURL_ErrorPaths(t *testing.T) {
|
||||||
data: WebhookPayloadData{Message: "api"},
|
data: WebhookPayloadData{Message: "api"},
|
||||||
wantErr: "missing scheme or host",
|
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 {
|
for _, tt := range tests {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue