瀏覽代碼

test(alerting): update dashboard json

bergquist 9 年之前
父節點
當前提交
8d4aa5d114
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      pkg/services/sqlstore/dashboard_parser_test.go

+ 5 - 4
pkg/services/sqlstore/dashboard_parser_test.go

@@ -108,7 +108,7 @@ func TestAlertModel(t *testing.T) {
             "warnOperator": ">",
             "warnOperator": ">",
             "critOperator": ">",
             "critOperator": ">",
             "aggregator": "sum",
             "aggregator": "sum",
-            "queryRange": "10m",
+            "queryRange": 3600,
             "frequency": 10,
             "frequency": 10,
             "name": "active desktop users",
             "name": "active desktop users",
             "description": "restart webservers"
             "description": "restart webservers"
@@ -195,9 +195,9 @@ func TestAlertModel(t *testing.T) {
             "warnLevel": 300,
             "warnLevel": 300,
             "critLevel": 500,
             "critLevel": 500,
             "aggregator": "avg",
             "aggregator": "avg",
-            "queryRange": "10m",
+            "queryRange": 3600,
             "frequency": 10,
             "frequency": 10,
-            "title": "active mobile users",
+            "name": "active mobile users",
             "description": "restart itunes"
             "description": "restart itunes"
           },
           },
           "links": []
           "links": []
@@ -385,7 +385,8 @@ func TestAlertModel(t *testing.T) {
 				So(v.Aggregator, ShouldNotBeEmpty)
 				So(v.Aggregator, ShouldNotBeEmpty)
 				So(v.Query, ShouldNotBeEmpty)
 				So(v.Query, ShouldNotBeEmpty)
 				So(v.QueryRefId, ShouldNotBeEmpty)
 				So(v.QueryRefId, ShouldNotBeEmpty)
-				So(v.QueryRange, ShouldNotBeEmpty)
+				So(v.QueryRange, ShouldNotEqual, 0)
+				So(v.Frequency, ShouldNotEqual, 0)
 				So(v.Name, ShouldNotBeEmpty)
 				So(v.Name, ShouldNotBeEmpty)
 				So(v.Description, ShouldNotBeEmpty)
 				So(v.Description, ShouldNotBeEmpty)
 			}
 			}