fix error code for delete folder (#42470)

This commit is contained in:
ying-jeanne
2021-11-30 21:07:04 +08:00
committed by GitHub
parent 4e8b97b8ed
commit e13e6a7bd7
2 changed files with 12 additions and 0 deletions
@@ -67,6 +67,12 @@ func TestDeleteLibraryPanelsInFolder(t *testing.T) {
require.EqualError(t, err, ErrFolderHasConnectedLibraryElements.Error())
})
scenarioWithPanel(t, "When an admin tries to delete a folder uid that doesn't exist, it should fail",
func(t *testing.T, sc scenarioContext) {
err := sc.service.DeleteLibraryElementsInFolder(sc.reqContext.Req.Context(), sc.reqContext.SignedInUser, sc.folder.Uid+"xxxx")
require.EqualError(t, err, models.ErrFolderNotFound.Error())
})
scenarioWithPanel(t, "When an admin tries to delete a folder that contains disconnected elements, it should delete all disconnected elements too",
func(t *testing.T, sc scenarioContext) {
command := getCreateVariableCommand(sc.folder.Id, "query0")