Dashboards: Fix restoring dashboard to root folder (#89020)

* Fix restoring dashboard to root folder

* use a root folder representation instead of nil

* change root folder by general folder

---------

Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
This commit is contained in:
Sofia Papagiannaki
2024-06-18 14:21:40 +03:00
committed by GitHub
parent b4c5c62f59
commit 0afbaa39df
3 changed files with 23 additions and 1 deletions
@@ -395,6 +395,21 @@ func TestIntegrationFolderService(t *testing.T) {
"For error '%s' expected error '%s', actual '%s'", tc.ActualError, tc.ExpectedError, actualError)
}
})
t.Run("Returns root folder", func(t *testing.T) {
t.Run("When the folder UID is blank should return the root folder", func(t *testing.T) {
emptyString := ""
actual, err := service.Get(context.Background(), &folder.GetFolderQuery{
UID: &emptyString,
OrgID: 1,
SignedInUser: usr,
})
assert.NoError(t, err)
assert.Equal(t, folder.GeneralFolder.UID, actual.UID)
assert.Equal(t, folder.GeneralFolder.Title, actual.Title)
})
})
})
}