Commit 0f9b5924 by bergquist

provisioning: fixes broken tests

parent 77e7887e
...@@ -42,6 +42,11 @@ func TestDashboardApiEndpoint(t *testing.T) { ...@@ -42,6 +42,11 @@ func TestDashboardApiEndpoint(t *testing.T) {
return nil return nil
}) })
bus.AddHandler("test", func(query *m.GetProvisionedDashboardByDashboardId) error {
query.Result = nil
return nil
})
viewerRole := m.ROLE_VIEWER viewerRole := m.ROLE_VIEWER
editorRole := m.ROLE_EDITOR editorRole := m.ROLE_EDITOR
...@@ -192,6 +197,11 @@ func TestDashboardApiEndpoint(t *testing.T) { ...@@ -192,6 +197,11 @@ func TestDashboardApiEndpoint(t *testing.T) {
fakeDash.HasAcl = true fakeDash.HasAcl = true
setting.ViewersCanEdit = false setting.ViewersCanEdit = false
bus.AddHandler("test", func(query *m.GetProvisionedDashboardByDashboardId) error {
query.Result = nil
return nil
})
bus.AddHandler("test", func(query *m.GetDashboardsBySlugQuery) error { bus.AddHandler("test", func(query *m.GetDashboardsBySlugQuery) error {
dashboards := []*m.Dashboard{fakeDash} dashboards := []*m.Dashboard{fakeDash}
query.Result = dashboards query.Result = dashboards
...@@ -625,6 +635,11 @@ func TestDashboardApiEndpoint(t *testing.T) { ...@@ -625,6 +635,11 @@ func TestDashboardApiEndpoint(t *testing.T) {
dashTwo.FolderId = 3 dashTwo.FolderId = 3
dashTwo.HasAcl = false dashTwo.HasAcl = false
bus.AddHandler("test", func(query *m.GetProvisionedDashboardByDashboardId) error {
query.Result = nil
return nil
})
bus.AddHandler("test", func(query *m.GetDashboardsBySlugQuery) error { bus.AddHandler("test", func(query *m.GetDashboardsBySlugQuery) error {
dashboards := []*m.Dashboard{dashOne, dashTwo} dashboards := []*m.Dashboard{dashOne, dashTwo}
query.Result = dashboards query.Result = dashboards
...@@ -751,6 +766,11 @@ func TestDashboardApiEndpoint(t *testing.T) { ...@@ -751,6 +766,11 @@ func TestDashboardApiEndpoint(t *testing.T) {
return nil return nil
}) })
bus.AddHandler("test", func(query *m.GetProvisionedDashboardByDashboardId) error {
query.Result = nil
return nil
})
bus.AddHandler("test", func(query *m.GetDashboardVersionQuery) error { bus.AddHandler("test", func(query *m.GetDashboardVersionQuery) error {
query.Result = &m.DashboardVersion{ query.Result = &m.DashboardVersion{
Data: simplejson.NewFromAny(map[string]interface{}{ Data: simplejson.NewFromAny(map[string]interface{}{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment