(t *testing.T)
| 43 | } |
| 44 | |
| 45 | func TestFieldVisual_StringAndJSON(t *testing.T) { |
| 46 | cases := []struct { |
| 47 | value FieldVisual |
| 48 | expected string |
| 49 | }{ |
| 50 | {FieldVisualValue, "value"}, |
| 51 | {FieldVisualBar, "bar"}, |
| 52 | {FieldVisualPill, "pill"}, |
| 53 | {FieldVisualRichValue, "richValue"}, |
| 54 | {FieldVisualFeedTemplate, "feedTemplate"}, |
| 55 | {FieldVisualRowOptions, "rowOptions"}, |
| 56 | {FieldVisual(250), "value"}, |
| 57 | } |
| 58 | |
| 59 | for _, tc := range cases { |
| 60 | t.Run(tc.expected, func(t *testing.T) { |
| 61 | assert.Equal(t, tc.expected, tc.value.String()) |
| 62 | data, err := json.Marshal(tc.value) |
| 63 | require.NoError(t, err) |
| 64 | assert.Equal(t, `"`+tc.expected+`"`, string(data)) |
| 65 | }) |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | func TestFieldTransform_StringAndJSON(t *testing.T) { |
| 70 | cases := []struct { |
nothing calls this directly
no test coverage detected
searching dependent graphs…