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
87d6d791
Commit
87d6d791
authored
Jan 30, 2018
by
Daniel Lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashfolders: adds comment for dashboard api tests
parent
2b798435
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
pkg/api/dashboard_test.go
+16
-0
No files found.
pkg/api/dashboard_test.go
View file @
87d6d791
...
...
@@ -28,6 +28,10 @@ func (repo *fakeDashboardRepo) SaveDashboard(json *dashboards.SaveDashboardItem)
var
fakeRepo
*
fakeDashboardRepo
// This tests two main scenarios. If a user has access to execute an action on a dashboard:
// 1. and the dashboard is in a folder which does not have an acl
// 2. and the dashboard is in a folder which does have an acl
func
TestDashboardApiEndpoint
(
t
*
testing
.
T
)
{
Convey
(
"Given a dashboard with a parent folder which does not have an acl"
,
t
,
func
()
{
fakeDash
:=
m
.
NewDashboard
(
"Child dash"
)
...
...
@@ -66,6 +70,10 @@ func TestDashboardApiEndpoint(t *testing.T) {
}),
}
// This tests two scenarios:
// 1. user is an org viewer
// 2. user is an org editor
Convey
(
"When user is an Org Viewer"
,
func
()
{
role
:=
m
.
ROLE_VIEWER
...
...
@@ -196,6 +204,14 @@ func TestDashboardApiEndpoint(t *testing.T) {
}),
}
// This tests six scenarios:
// 1. user is an org viewer AND has no permissions for this dashboard
// 2. user is an org editor AND has no permissions for this dashboard
// 3. user is an org viewer AND has been granted edit permission for the dashboard
// 4. user is an org viewer AND all viewers have edit permission for this dashboard
// 5. user is an org viewer AND has been granted an admin permission
// 6. user is an org editor AND has been granted a view permission
Convey
(
"When user is an Org Viewer and has no permissions for this dashboard"
,
func
()
{
role
:=
m
.
ROLE_VIEWER
...
...
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