mirror of https://github.com/grafana/grafana
InfluxDB: Check the value type before casting it to the string (#80986)
* Check the value type before casting it to the string * set visualization as table by default * append all values for show diagnostics * golangci-lint * append metadata only to first framepull/81280/head
parent
c6793d4f12
commit
14e55fefbb
@ -0,0 +1,23 @@ |
||||
package util |
||||
|
||||
import ( |
||||
"testing" |
||||
|
||||
"github.com/stretchr/testify/require" |
||||
) |
||||
|
||||
func TestParseString(t *testing.T) { |
||||
t.Run("parse bool value to string", func(t *testing.T) { |
||||
val := true |
||||
expected := ToPtr("true") |
||||
result := ParseString(val) |
||||
require.Equal(t, expected, result) |
||||
}) |
||||
|
||||
t.Run("parse number value to string", func(t *testing.T) { |
||||
val := 123 |
||||
expected := ToPtr("123") |
||||
result := ParseString(val) |
||||
require.Equal(t, expected, result) |
||||
}) |
||||
} |
Loading…
Reference in new issue