Skip to content

Commit

Permalink
Show that timeseries decoding also decodes targets
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Phoen committed Nov 21, 2021
1 parent 0cb1af0 commit 28d1435
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion internal/pkg/converter/timeseries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ func TestConvertTimeSeriesPanel(t *testing.T) {
Height: height,
Datasource: &datasource,
},
TimeseriesPanel: &sdk.TimeseriesPanel{},
TimeseriesPanel: &sdk.TimeseriesPanel{
Targets: []sdk.Target{
{
Expr: "prometheus_query",
LegendFormat: "{{ field }}",
RefID: "A",
},
},
},
}

converted, ok := converter.convertDataPanel(panel)
Expand All @@ -40,6 +48,7 @@ func TestConvertTimeSeriesPanel(t *testing.T) {
req.Equal("timeseries description", convertedTs.Description)
req.Equal(height, convertedTs.Height)
req.Equal(datasource, convertedTs.Datasource)
req.Len(convertedTs.Targets, 1)
}

func TestConvertTimeSeriesLegendDisplay(t *testing.T) {
Expand Down

0 comments on commit 28d1435

Please sign in to comment.