fix!: Default Alert.Enabled to true (#380)

BREAKING CHANGE: It used to default to false, which meant that users had to explicitly set endpoints[].alerts[].enabled to true
This commit is contained in:
TwiN
2022-12-05 23:15:19 -05:00
committed by GitHub
parent 7dccf5f08c
commit d058d7a54b
6 changed files with 14 additions and 38 deletions

View File

@ -372,8 +372,8 @@ func TestEndpoint_ValidateAndSetDefaults(t *testing.T) {
if len(endpoint.Alerts) != 1 {
t.Error("Endpoint should've had 1 alert")
}
if endpoint.Alerts[0].IsEnabled() {
t.Error("Endpoint alert should've defaulted to disabled")
if !endpoint.Alerts[0].IsEnabled() {
t.Error("Endpoint alert should've defaulted to true")
}
if endpoint.Alerts[0].SuccessThreshold != 2 {
t.Error("Endpoint alert should've defaulted to a success threshold of 2")