Chore: Remove bus from dashboard service (#46829)

* Move DeleteDashboard funtion into dashboards store service, remove bus and update tests

* Remove bus from folder service and update more tests

* Fix mock
This commit is contained in:
Selene
2022-03-22 14:36:50 +01:00
committed by GitHub
parent bfb03d779d
commit b2af18f129
15 changed files with 183 additions and 202 deletions

View File

@@ -47,12 +47,6 @@ func TestDashboardPermissionAPIEndpoint(t *testing.T) {
})
guardian.MockDashboardGuardian(&guardian.FakeDashboardGuardian{CanAdminValue: false})
getDashboardQueryResult := models.NewDashboard("Dash")
mockSQLStore := mockstore.NewSQLStoreMock()
mockSQLStore.ExpectedDashboard = getDashboardQueryResult
mockSQLStore.ExpectedError = nil
hs.SQLStore = mockSQLStore
loggedInUserScenarioWithRole(t, "When calling GET on", "GET", "/api/dashboards/id/1/permissions",
"/api/dashboards/id/:dashboardId/permissions", models.ROLE_EDITOR, func(sc *scenarioContext) {
callGetDashboardPermissions(sc, hs)
@@ -96,10 +90,6 @@ func TestDashboardPermissionAPIEndpoint(t *testing.T) {
},
})
mockSQLStore := mockstore.NewSQLStoreMock()
mockSQLStore.ExpectedDashboard = models.NewDashboard("Dash")
hs.SQLStore = mockSQLStore
loggedInUserScenarioWithRole(t, "When calling GET on", "GET", "/api/dashboards/id/1/permissions",
"/api/dashboards/id/:dashboardId/permissions", models.ROLE_ADMIN, func(sc *scenarioContext) {
callGetDashboardPermissions(sc, hs)