Dashboard Migrations: V4 - no-op and clean up dead code from DashboardMigrator.ts (#112225)

This commit is contained in:
Haris Rozajac
2025-10-14 14:38:31 -06:00
committed by GitHub
parent 3d112755de
commit 01c4cb1fac
8 changed files with 220 additions and 16 deletions
@@ -0,0 +1,38 @@
package schemaversion_test
import (
"testing"
"github.com/grafana/grafana/apps/dashboard/pkg/migration/schemaversion"
)
func TestV4(t *testing.T) {
tests := []migrationTestCase{
{
name: "v4 no-op migration, updates schema version only",
input: map[string]interface{}{
"title": "V4 No-Op Migration Test Dashboard",
"schemaVersion": 3,
"panels": []interface{}{
map[string]interface{}{
"type": "graph",
"title": "Panel remains unchanged",
"id": 1,
},
},
},
expected: map[string]interface{}{
"title": "V4 No-Op Migration Test Dashboard",
"schemaVersion": 4,
"panels": []interface{}{
map[string]interface{}{
"type": "graph",
"title": "Panel remains unchanged",
"id": 1,
},
},
},
},
}
runMigrationTests(t, tests, schemaversion.V4)
}