The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/apps/dashboard/pkg/migration/schemaversion/v41_test.go

38 lines
855 B

package schemaversion_test
import (
"testing"
"github.com/grafana/grafana/apps/dashboard/pkg/migration/schemaversion"
)
func TestV41(t *testing.T) {
tests := []migrationTestCase{
{
name: "time_options is removed",
input: map[string]interface{}{
"title": "Test Dashboard",
"timepicker": map[string]interface{}{
"time_options": []string{"1m", "5m", "15m", "1h", "6h", "12h", "24h"},
},
},
expected: map[string]interface{}{
"title": "Test Dashboard",
"schemaVersion": 41,
"timepicker": map[string]interface{}{},
},
},
{
name: "timepicker is not set",
input: map[string]interface{}{
"title": "Test Dashboard",
},
expected: map[string]interface{}{
"title": "Test Dashboard",
"schemaVersion": 41,
},
},
}
runMigrationTests(t, tests, schemaversion.V41)
}