Просмотр исходного кода

adding tests, but they arent running locally

ryan 7 лет назад
Родитель
Сommit
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() {