Merge pull request #30783 from rpolishchuk/investigate-TestValidateChartIconPresence

fix: chart icon presence test
pull/30786/head
Matt Farina 5 months ago committed by GitHub
commit fcd37bcea7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -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) {

Loading…
Cancel
Save