WIP: dashlist in template for new folder

This commit is contained in:
Daniel Lee
2017-06-12 15:49:09 +02:00
parent 533f2d3d72
commit 5c89c4b2bd
6 changed files with 62 additions and 7 deletions
+23
View File
@@ -28,4 +28,27 @@ func TestDashboardModel(t *testing.T) {
})
})
Convey("Given a new dashboard folder", t, func() {
json := simplejson.New()
json.Set("title", "test dash")
cmd := &SaveDashboardCommand{Dashboard: json, IsFolder: true}
dash := cmd.GetDashboardModel()
Convey("Should set IsFolder to true", func() {
So(dash.IsFolder, ShouldBeTrue)
})
})
Convey("Given a child dashboard", t, func() {
json := simplejson.New()
json.Set("title", "test dash")
cmd := &SaveDashboardCommand{Dashboard: json, ParentId: 1}
dash := cmd.GetDashboardModel()
Convey("Should set ParentId", func() {
So(dash.ParentId, ShouldEqual, 1)
})
})
}