Elasticsearch: Fix where name of frame is set (#64233)

* Elasticsearch: Use displayName field for naming

* Change solution to frame.Name to be backward compatible

* Fix snapshot tests

* Use Time and Value for time and value fields

* Use variables from grafana-plugin-sdk-go for name
This commit is contained in:
Ivana Huckova
2023-03-08 13:32:01 +01:00
committed by GitHub
parent 1cb39b3523
commit aa123e0d50
8 changed files with 158 additions and 195 deletions
@@ -61,18 +61,7 @@ func requireFloatAt(t *testing.T, expected float64, field *data.Field, index int
}
func requireTimeSeriesName(t *testing.T, expected string, frame *data.Frame) {
getField := func() *data.Field {
for _, field := range frame.Fields {
if field.Type() != data.FieldTypeTime {
return field
}
}
return nil
}
field := getField()
require.NotNil(t, expected, field.Config)
require.Equal(t, expected, field.Config.DisplayNameFromDS)
require.Equal(t, expected, frame.Name)
}
func TestRefIdMatching(t *testing.T) {