(t *testing.T)
| 184 | } |
| 185 | |
| 186 | func TestValidateChartSources(t *testing.T) { |
| 187 | var failTest = []string{"", "RiverRun", "john@winterfell", "riverrun.io"} |
| 188 | var successTest = []string{"http://riverrun.io", "https://riverrun.io", "https://riverrun.io/blackfish"} |
| 189 | for _, test := range failTest { |
| 190 | badChart.Sources = []string{test} |
| 191 | err := validateChartSources(badChart) |
| 192 | if err == nil || !strings.Contains(err.Error(), "invalid source URL") { |
| 193 | t.Errorf("validateChartSources(%s) to return \"invalid source URL\", got no error", test) |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | for _, test := range successTest { |
| 198 | badChart.Sources = []string{test} |
| 199 | err := validateChartSources(badChart) |
| 200 | if err != nil { |
| 201 | t.Errorf("validateChartSources(%s) to return no error, got %s", test, err.Error()) |
| 202 | } |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | func TestValidateChartIconPresence(t *testing.T) { |
| 207 | t.Run("Icon absent", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…