feat(alerting): removed severity
This commit is contained in:
@@ -3,34 +3,32 @@ package notifiers
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/grafana/grafana/pkg/components/simplejson"
|
||||
m "github.com/grafana/grafana/pkg/models"
|
||||
. "github.com/smartystreets/goconvey/convey"
|
||||
)
|
||||
|
||||
func TestBaseNotifier(t *testing.T) {
|
||||
Convey("Parsing base notification severity", t, func() {
|
||||
|
||||
Convey("matches", func() {
|
||||
json := `
|
||||
{
|
||||
"severityFilter": "critical"
|
||||
}`
|
||||
|
||||
settingsJSON, _ := simplejson.NewJson([]byte(json))
|
||||
not := NewNotifierBase("ops", "email", settingsJSON)
|
||||
So(not.MatchSeverity(m.AlertSeverityCritical), ShouldBeTrue)
|
||||
})
|
||||
|
||||
Convey("does not match", func() {
|
||||
json := `
|
||||
{
|
||||
"severityFilter": "critical"
|
||||
}`
|
||||
|
||||
settingsJSON, _ := simplejson.NewJson([]byte(json))
|
||||
not := NewNotifierBase("ops", "email", settingsJSON)
|
||||
So(not.MatchSeverity(m.AlertSeverityWarning), ShouldBeFalse)
|
||||
})
|
||||
})
|
||||
// Convey("Parsing base notification state", t, func() {
|
||||
//
|
||||
// Convey("matches", func() {
|
||||
// json := `
|
||||
// {
|
||||
// "states": "critical"
|
||||
// }`
|
||||
//
|
||||
// settingsJSON, _ := simplejson.NewJson([]byte(json))
|
||||
// not := NewNotifierBase("ops", "email", settingsJSON)
|
||||
// So(not.MatchSeverity(m.AlertSeverityCritical), ShouldBeTrue)
|
||||
// })
|
||||
//
|
||||
// Convey("does not match", func() {
|
||||
// json := `
|
||||
// {
|
||||
// "severityFilter": "critical"
|
||||
// }`
|
||||
//
|
||||
// settingsJSON, _ := simplejson.NewJson([]byte(json))
|
||||
// not := NewNotifierBase("ops", "email", settingsJSON)
|
||||
// So(not.MatchSeverity(m.AlertSeverityWarning), ShouldBeFalse)
|
||||
// })
|
||||
// })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user