Remove folderid service test (#80433)

* Remove FolderID from service tests

* Add models

* Add folderID pack to publicdashboard tests

* Remove folderID from dashboard tests

* Remove folderID from folders

* Remove folderID from ngalert tests

* Remove nolint comment

* Add back some tests after rebase
This commit is contained in:
idafurjes
2024-01-12 16:43:39 +01:00
committed by GitHub
parent e553d4b796
commit cb419e799b
18 changed files with 105 additions and 273 deletions
@@ -763,7 +763,7 @@ func TestGetDashboardByFolder(t *testing.T) {
pubdashStore := ProvideStore(sqlStore, cfg, featuremgmt.WithFeatures())
dashboard := insertTestDashboard(t, dashboardStore, "title", 1, 1, "1", true, PublicShareType)
pubdash := insertPublicDashboard(t, pubdashStore, dashboard.UID, dashboard.OrgID, true, PublicShareType)
dashboard2 := insertTestDashboard(t, dashboardStore, "title", 1, 2, "2", true, PublicShareType)
dashboard2 := insertTestDashboard(t, dashboardStore, "title2", 1, 2, "2", true, PublicShareType)
_ = insertPublicDashboard(t, pubdashStore, dashboard2.UID, dashboard2.OrgID, true, PublicShareType)
pubdashes, err := pubdashStore.FindByDashboardFolder(context.Background(), dashboard)
@@ -838,12 +838,12 @@ func TestGetMetrics(t *testing.T) {
}
// helper function to insert a dashboard
func insertTestDashboard(t *testing.T, dashboardStore dashboards.Store, title string, orgId int64,
folderId int64, folderUID string, isFolder bool, tags ...any) *dashboards.Dashboard {
func insertTestDashboard(t *testing.T, dashboardStore dashboards.Store, title string, orgID int64,
folderID int64, folderUID string, isFolder bool, tags ...any) *dashboards.Dashboard {
t.Helper()
cmd := dashboards.SaveDashboardCommand{
OrgID: orgId,
FolderID: folderId, // nolint:staticcheck
OrgID: orgID,
FolderID: folderID, // nolint:staticcheck
FolderUID: folderUID,
IsFolder: isFolder,
Dashboard: simplejson.NewFromAny(map[string]any{