test(alerting): Fix tests following change to defaults

This commit is contained in:
TwiN 2022-10-09 16:34:08 -04:00
parent 5f8e62dad0
commit 1a708ebca2

View File

@ -14,9 +14,9 @@ func TestAlertDefaultProvider_IsValid(t *testing.T) {
expected: true,
},
{
name: "invalid-url",
provider: AlertProvider{URL: "", Topic: "example", Priority: 1},
expected: false,
name: "no-url-should-use-default-value",
provider: AlertProvider{Topic: "example", Priority: 1},
expected: true,
},
{
name: "invalid-topic",
@ -30,9 +30,14 @@ func TestAlertDefaultProvider_IsValid(t *testing.T) {
},
{
name: "invalid-priority-too-low",
provider: AlertProvider{URL: "https://ntfy.sh", Topic: "example", Priority: 0},
provider: AlertProvider{URL: "https://ntfy.sh", Topic: "example", Priority: -1},
expected: false,
},
{
name: "no-priority-should-use-default-value",
provider: AlertProvider{URL: "https://ntfy.sh", Topic: "example"},
expected: true,
},
}
for _, scenario := range scenarios {
t.Run(scenario.name, func(t *testing.T) {