|
@@ -42,6 +42,7 @@ func TestAnnotations(t *testing.T) {
|
|
|
UserId: 1,
|
|
UserId: 1,
|
|
|
DashboardId: 1,
|
|
DashboardId: 1,
|
|
|
Text: "hello",
|
|
Text: "hello",
|
|
|
|
|
+ Type: "alert",
|
|
|
Epoch: 10,
|
|
Epoch: 10,
|
|
|
Tags: []string{"outage", "error", "type:outage", "server:server-1"},
|
|
Tags: []string{"outage", "error", "type:outage", "server:server-1"},
|
|
|
}
|
|
}
|
|
@@ -91,6 +92,19 @@ func TestAnnotations(t *testing.T) {
|
|
|
So(items, ShouldHaveLength, 0)
|
|
So(items, ShouldHaveLength, 0)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ Convey("Should not find one when type filter does not match", func() {
|
|
|
|
|
+ items, err := repo.Find(&annotations.ItemQuery{
|
|
|
|
|
+ OrgId: 1,
|
|
|
|
|
+ DashboardId: 1,
|
|
|
|
|
+ From: 1,
|
|
|
|
|
+ To: 15,
|
|
|
|
|
+ Type: "alert",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ So(err, ShouldBeNil)
|
|
|
|
|
+ So(items, ShouldHaveLength, 0)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
Convey("Should find one when all tag filters does match", func() {
|
|
Convey("Should find one when all tag filters does match", func() {
|
|
|
items, err := repo.Find(&annotations.ItemQuery{
|
|
items, err := repo.Find(&annotations.ItemQuery{
|
|
|
OrgId: 1,
|
|
OrgId: 1,
|