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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user