diff --git a/influx/query_test.go b/influx/query_test.go index 362b55a3b5..f8bcf2e20c 100644 --- a/influx/query_test.go +++ b/influx/query_test.go @@ -629,6 +629,31 @@ func TestConvert(t *testing.T) { AreTagsAccepted: false, }, }, + { + name: "count with aggregate", + influxQL: `SELECT COUNT(water) as "count_water" FROM "h2o_feet"`, + want: chronograf.QueryConfig{ + Measurement: "h2o_feet", + Fields: []chronograf.Field{ + chronograf.Field{ + Value: "count", + Type: "func", + Alias: "count_water", + Args: []chronograf.Field{ + { + Value: "water", + Type: "field", + }, + }, + }, + }, + GroupBy: chronograf.GroupBy{ + Tags: []string{}, + }, + Tags: map[string][]string{}, + AreTagsAccepted: false, + }, + }, { name: "count of a wildcard", influxQL: ` SELECT COUNT(*) FROM "h2o_feet"`,