(t *testing.T)
| 204 | } |
| 205 | |
| 206 | func TestValidateChartIconPresence(t *testing.T) { |
| 207 | t.Run("Icon absent", func(t *testing.T) { |
| 208 | testChart := &chart.Metadata{ |
| 209 | Icon: "", |
| 210 | } |
| 211 | |
| 212 | err := validateChartIconPresence(testChart) |
| 213 | |
| 214 | if err == nil { |
| 215 | t.Error("validateChartIconPresence to return a linter error, got no error") |
| 216 | } else if !strings.Contains(err.Error(), "icon is recommended") { |
| 217 | t.Errorf("expected %q, got %q", "icon is recommended", err.Error()) |
| 218 | } |
| 219 | }) |
| 220 | t.Run("Icon present", func(t *testing.T) { |
| 221 | testChart := &chart.Metadata{ |
| 222 | Icon: "http://example.org/icon.png", |
| 223 | } |
| 224 | |
| 225 | err := validateChartIconPresence(testChart) |
| 226 | |
| 227 | if err != nil { |
| 228 | t.Errorf("Unexpected error: %q", err.Error()) |
| 229 | } |
| 230 | }) |
| 231 | } |
| 232 | |
| 233 | func TestValidateChartIconURL(t *testing.T) { |
| 234 | var failTest = []string{"RiverRun", "john@winterfell", "riverrun.io"} |
nothing calls this directly
no test coverage detected
searching dependent graphs…