|
|
|
@ -166,10 +166,30 @@ func TestValidateChartSources(t *testing.T) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestValidateChartIconPresence(t *testing.T) {
|
|
|
|
|
err := validateChartIconPresence(badChart)
|
|
|
|
|
t.Run("Icon absent", func(t *testing.T) {
|
|
|
|
|
testChart := &chart.Metadata{
|
|
|
|
|
Icon: "",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
err := validateChartIconPresence(testChart)
|
|
|
|
|
|
|
|
|
|
if err == nil {
|
|
|
|
|
t.Errorf("validateChartIconPresence to return a linter error, got no error")
|
|
|
|
|
} else if !strings.Contains(err.Error(), "icon is recommended") {
|
|
|
|
|
t.Errorf("expected %q, got %q", "icon is recommended", err.Error())
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
t.Run("Icon present", func(t *testing.T) {
|
|
|
|
|
testChart := &chart.Metadata{
|
|
|
|
|
Icon: "http://example.org/icon.png",
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
err := validateChartIconPresence(testChart)
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
t.Errorf("Unexpected error: %q", err.Error())
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func TestValidateChartIconURL(t *testing.T) {
|
|
|
|
|