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
89db9cc9
Commit
89db9cc9
authored
Dec 12, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fixed dashboard api tests
parent
de91d684
Show 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 @
89db9cc9
...
...
@@ -14,10 +14,23 @@ import (
"github.com/grafana/grafana/pkg/middleware"
m
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/alerting"
"github.com/grafana/grafana/pkg/services/dashboards"
.
"github.com/smartystreets/goconvey/convey"
)
type
fakeDashboardRepo
struct
{
inserted
[]
*
dashboards
.
SaveDashboardItem
getDashboard
[]
*
m
.
Dashboard
}
func
(
repo
*
fakeDashboardRepo
)
SaveDashboard
(
json
*
dashboards
.
SaveDashboardItem
)
(
*
m
.
Dashboard
,
error
)
{
repo
.
inserted
=
append
(
repo
.
inserted
,
json
)
return
json
.
Dashboard
,
nil
}
var
fakeRepo
*
fakeDashboardRepo
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"
)
...
...
@@ -500,6 +513,9 @@ func postDashboardScenario(desc string, url string, routePattern string, role m.
return
PostDashboard
(
c
,
cmd
)
})
fakeRepo
=
&
fakeDashboardRepo
{}
dashboards
.
SetRepository
(
fakeRepo
)
sc
.
m
.
Post
(
routePattern
,
sc
.
defaultHandler
)
fn
(
sc
)
...
...
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