dashboards: render correct link for folder when searching for dashboards (#10763)

Fixes #10761
This commit is contained in:
Marcus Efraimsson
2018-02-05 13:23:24 +01:00
committed by Torkel Ödegaard
parent 20feb123c9
commit a879dd8c0c
7 changed files with 26 additions and 12 deletions

View File

@@ -147,6 +147,7 @@ func TestDashboardDataAccess(t *testing.T) {
hit := query.Result[0]
So(hit.Type, ShouldEqual, search.DashHitFolder)
So(hit.Url, ShouldEqual, fmt.Sprintf("/dashboards/f/%s/%s", savedFolder.Uid, savedFolder.Slug))
So(hit.FolderTitle, ShouldEqual, "")
})
Convey("Should be able to search for a dashboard folder's children", func() {
@@ -163,6 +164,10 @@ func TestDashboardDataAccess(t *testing.T) {
hit := query.Result[0]
So(hit.Id, ShouldEqual, savedDash.Id)
So(hit.Url, ShouldEqual, fmt.Sprintf("/d/%s/%s", savedDash.Uid, savedDash.Slug))
So(hit.FolderId, ShouldEqual, savedFolder.Id)
So(hit.FolderUid, ShouldEqual, savedFolder.Uid)
So(hit.FolderTitle, ShouldEqual, savedFolder.Title)
So(hit.FolderUrl, ShouldEqual, fmt.Sprintf("/dashboards/f/%s/%s", savedFolder.Uid, savedFolder.Slug))
})
Convey("Should be able to search for dashboard by dashboard ids", func() {