mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): more refactoring work in backend code
This commit is contained in:
@@ -39,6 +39,7 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
"handler": 1,
|
||||
"enabled": true,
|
||||
"frequency": "60s",
|
||||
"severity": "critical",
|
||||
"conditions": [
|
||||
{
|
||||
"type": "query",
|
||||
@@ -63,6 +64,7 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
"handler": 0,
|
||||
"enabled": true,
|
||||
"frequency": "60s",
|
||||
"severity": "warning",
|
||||
"conditions": [
|
||||
{
|
||||
"type": "query",
|
||||
@@ -122,6 +124,11 @@ func TestAlertRuleExtraction(t *testing.T) {
|
||||
So(alerts[1].Handler, ShouldEqual, 0)
|
||||
})
|
||||
|
||||
Convey("should extract Severity property", func() {
|
||||
So(alerts[0].Severity, ShouldEqual, "critical")
|
||||
So(alerts[1].Severity, ShouldEqual, "warning")
|
||||
})
|
||||
|
||||
Convey("should extract frequency in seconds", func() {
|
||||
So(alerts[0].Frequency, ShouldEqual, 60)
|
||||
So(alerts[1].Frequency, ShouldEqual, 60)
|
||||
|
||||
Reference in New Issue
Block a user