瀏覽代碼

adding tests, but they arent running locally

ryan 7 年之前
父節點
當前提交
db91033b6e
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      pkg/services/sqlstore/annotation_test.go

+ 10 - 0
pkg/services/sqlstore/annotation_test.go

@@ -79,6 +79,12 @@ func TestAnnotations(t *testing.T) {
 				Convey("Can read tags", func() {
 					So(items[0].Tags, ShouldResemble, []string{"outage", "error", "type:outage", "server:server-1"})
 				})
+
+				Convey("Has created and updated values", func() {
+					So(items[0].created, ShouldBeGreaterThan, 0)
+					So(items[0].updated, ShouldBeGreaterThan, 0)
+					So(items[0].created, ShouldBeEqual, items[1].created)
+				})
 			})
 
 			Convey("Can query for annotation by id", func() {
@@ -231,6 +237,10 @@ func TestAnnotations(t *testing.T) {
 					So(items[0].Tags, ShouldResemble, []string{"newtag1", "newtag2"})
 					So(items[0].Text, ShouldEqual, "something new")
 				})
+
+				Convey("Updated time has increased", func() {
+					So(items[0].updated, ShouldBeGreaterThan, items[0].created)
+				})
 			})
 
 			Convey("Can delete annotation", func() {