Chore: Remove dashboard version from models (#50287)

* Remove dashbpard version from models

* Fix lint

* Fix api & sqlstore tests

* Remove integration tags

* Fix lint again

* Add integration test to correct namespace

* Lont fix 2

* Change Id to ID in dashVersionMeta
This commit is contained in:
idafurjes
2022-06-08 12:22:55 +02:00
committed by GitHub
parent a938ae1d9e
commit e9f8d582c8
11 changed files with 44 additions and 135 deletions
+1 -21
View File
@@ -722,20 +722,6 @@ func TestDashboardAPIEndpoint(t *testing.T) {
})
t.Run("Given two dashboards being compared", func(t *testing.T) {
dashboardvs := []*models.DashboardVersion{
{
DashboardId: 1,
Version: 1,
Data: simplejson.NewFromAny(map[string]interface{}{
"title": "Dash1",
})},
{
DashboardId: 2,
Version: 2,
Data: simplejson.NewFromAny(map[string]interface{}{
"title": "Dash2",
})},
}
fakeDashboardVersionService := dashvertest.NewDashboardVersionServiceFake()
fakeDashboardVersionService.ExpectedDashboardVersions = []*dashver.DashboardVersion{
{
@@ -753,7 +739,7 @@ func TestDashboardAPIEndpoint(t *testing.T) {
}),
},
}
sqlmock := mockstore.SQLStoreMock{ExpectedDashboardVersions: dashboardvs}
sqlmock := mockstore.SQLStoreMock{}
setUp := func() {
dashSvc := dashboards.NewFakeDashboardService(t)
dashSvc.On("GetDashboardAclInfoList", mock.Anything, mock.AnythingOfType("*models.GetDashboardAclInfoListQuery")).Return(nil)
@@ -861,12 +847,6 @@ func TestDashboardAPIEndpoint(t *testing.T) {
Version: 1,
}
mockSQLStore := mockstore.NewSQLStoreMock()
mockSQLStore.ExpectedDashboardVersions = []*models.DashboardVersion{
{
DashboardId: 2,
Version: 1,
Data: fakeDash.Data,
}}
restoreDashboardVersionScenario(t, "When calling POST on", "/api/dashboards/id/1/restore",
"/api/dashboards/id/:dashboardId/restore", dashboardService, fakeDashboardVersionService, cmd, func(sc *scenarioContext) {
callRestoreDashboardVersion(sc)