Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
78283b9c
Commit
78283b9c
authored
Feb 21, 2018
by
Marcus Efraimsson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
folders: extend folder service tests
parent
a167e19b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
pkg/services/dashboards/folder_service_test.go
+23
-0
No files found.
pkg/services/dashboards/folder_service_test.go
View file @
78283b9c
...
...
@@ -164,5 +164,28 @@ func TestFolderService(t *testing.T) {
guardian
.
New
=
origNewGuardian
})
})
Convey
(
"Should map errors correct"
,
func
()
{
testCases
:=
[]
struct
{
ActualError
error
ExpectedError
error
}{
{
ActualError
:
models
.
ErrDashboardTitleEmpty
,
ExpectedError
:
models
.
ErrFolderTitleEmpty
},
{
ActualError
:
models
.
ErrDashboardUpdateAccessDenied
,
ExpectedError
:
models
.
ErrFolderAccessDenied
},
{
ActualError
:
models
.
ErrDashboardWithSameNameInFolderExists
,
ExpectedError
:
models
.
ErrFolderSameNameExists
},
{
ActualError
:
models
.
ErrDashboardWithSameUIDExists
,
ExpectedError
:
models
.
ErrFolderWithSameUIDExists
},
{
ActualError
:
models
.
ErrDashboardVersionMismatch
,
ExpectedError
:
models
.
ErrFolderVersionMismatch
},
{
ActualError
:
models
.
ErrDashboardNotFound
,
ExpectedError
:
models
.
ErrFolderNotFound
},
{
ActualError
:
models
.
ErrDashboardFailedGenerateUniqueUid
,
ExpectedError
:
models
.
ErrFolderFailedGenerateUniqueUid
},
{
ActualError
:
models
.
ErrDashboardInvalidUid
,
ExpectedError
:
models
.
ErrDashboardInvalidUid
},
}
for
_
,
tc
:=
range
testCases
{
actualError
:=
toFolderError
(
tc
.
ActualError
)
if
actualError
!=
tc
.
ExpectedError
{
t
.
Errorf
(
"For error '%s' expected error '%s', actual '%s'"
,
tc
.
ActualError
,
tc
.
ExpectedError
,
actualError
)
}
}
})
})
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment