mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
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:
@@ -52,14 +52,6 @@ func TestDashboardService(t *testing.T) {
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Should return validation error if it's a folder and have a folder id", func(t *testing.T) {
|
||||
dto.Dashboard = dashboards.NewDashboardFolder("Folder")
|
||||
// nolint:staticcheck
|
||||
dto.Dashboard.FolderID = 1
|
||||
_, err := service.SaveDashboard(context.Background(), dto, false)
|
||||
require.Equal(t, err, dashboards.ErrDashboardFolderCannotHaveParent)
|
||||
})
|
||||
|
||||
t.Run("Should return validation error if folder is named General", func(t *testing.T) {
|
||||
dto.Dashboard = dashboards.NewDashboardFolder("General")
|
||||
_, err := service.SaveDashboard(context.Background(), dto, false)
|
||||
@@ -234,8 +226,7 @@ func TestDashboardService(t *testing.T) {
|
||||
|
||||
t.Run("Count dashboards in folder", func(t *testing.T) {
|
||||
fakeStore.On("CountDashboardsInFolder", mock.Anything, mock.AnythingOfType("*dashboards.CountDashboardsInFolderRequest")).Return(int64(3), nil)
|
||||
// nolint:staticcheck
|
||||
folderSvc.ExpectedFolder = &folder.Folder{ID: 1}
|
||||
folderSvc.ExpectedFolder = &folder.Folder{UID: "i am a folder"}
|
||||
// set up a ctx with signed in user
|
||||
usr := &user.SignedInUser{UserID: 1}
|
||||
ctx := appcontext.WithUser(context.Background(), usr)
|
||||
|
||||
Reference in New Issue
Block a user