Nested Folders: Add tests for store methods (#57662)

* Nested Folders: Add store tests

* Fix parent order

* Fix update

* skip tests!

* Export test helpers for now
This commit is contained in:
Sofia Papagiannaki
2022-11-03 14:21:41 +01:00
committed by GitHub
parent 89548df5a4
commit 5c973e58bd
10 changed files with 854 additions and 86 deletions
+5 -5
View File
@@ -9,22 +9,22 @@ import (
// store is the interface which a folder store must implement.
type store interface {
// Create creates a folder and returns the newly-created folder.
Create(ctx context.Context, cmd *folder.CreateFolderCommand) (*folder.Folder, error)
Create(ctx context.Context, cmd folder.CreateFolderCommand) (*folder.Folder, error)
// Delete deletes a folder from the folder store.
Delete(ctx context.Context, uid string, orgID int64) error
// Update updates the given folder's UID, Title, and Description.
// Use Move to change a dashboard's parent ID.
Update(ctx context.Context, cmd *folder.UpdateFolderCommand) (*folder.Folder, error)
Update(ctx context.Context, cmd folder.UpdateFolderCommand) (*folder.Folder, error)
// Get returns a folder.
Get(ctx context.Context, cmd *folder.GetFolderQuery) (*folder.Folder, error)
Get(ctx context.Context, cmd folder.GetFolderQuery) (*folder.Folder, error)
// GetParents returns an ordered list of parent folder of the given folder.
GetParents(ctx context.Context, cmd *folder.GetParentsQuery) ([]*folder.Folder, error)
GetParents(ctx context.Context, cmd folder.GetParentsQuery) ([]*folder.Folder, error)
// GetChildren returns the set of immediate children folders (depth=1) of the
// given folder.
GetChildren(ctx context.Context, cmd *folder.GetTreeQuery) ([]*folder.Folder, error)
GetChildren(ctx context.Context, cmd folder.GetTreeQuery) ([]*folder.Folder, error)
}