diff --git a/src/main/java/com/jenkinsci/plugins/badge/action/BadgeAction.java b/src/main/java/com/jenkinsci/plugins/badge/action/BadgeAction.java index 38d49d4..852ed3e 100644 --- a/src/main/java/com/jenkinsci/plugins/badge/action/BadgeAction.java +++ b/src/main/java/com/jenkinsci/plugins/badge/action/BadgeAction.java @@ -200,9 +200,7 @@ public String getBorderColor() { */ public String getIconClass() { List classes = new LinkedList<>(); - if (isJenkinsSymbolRef(this.iconPath)) { - classes.add("icon-sm"); - } + classes.add("icon-sm"); // control icon image size if (this.color != null) { if (this.color.startsWith("jenkins-!-")) { diff --git a/src/test/java/com/jenkinsci/plugins/badge/action/BadgeActionTest.java b/src/test/java/com/jenkinsci/plugins/badge/action/BadgeActionTest.java index 6a8eb0e..3b55c4f 100644 --- a/src/test/java/com/jenkinsci/plugins/badge/action/BadgeActionTest.java +++ b/src/test/java/com/jenkinsci/plugins/badge/action/BadgeActionTest.java @@ -55,7 +55,7 @@ void getIconPath(@SuppressWarnings("unused") JenkinsRule r) { @Test void getIconClass(@SuppressWarnings("unused") JenkinsRule r) { BadgeAction action = BadgeAction.createBadge("info.gif", "text"); - assertEquals("", action.getIconClass()); + assertEquals("icon-sm", action.getIconClass()); action = BadgeAction.createBadge("symbol-star plugin-ionicons-api", "text"); assertEquals("icon-sm", action.getIconClass()); action = BadgeAction.createBadge("symbol-star plugin-ionicons-api", "#000000", "", null); @@ -63,7 +63,7 @@ void getIconClass(@SuppressWarnings("unused") JenkinsRule r) { action = BadgeAction.createBadge("symbol-star plugin-ionicons-api", "blue", "", null); assertEquals("icon-sm jenkins-!-color-blue", action.getIconClass()); action = BadgeAction.createBadge("/foo/symbol-star.gif", "blue", "", null); - assertEquals("jenkins-!-color-blue", action.getIconClass()); + assertEquals("icon-sm jenkins-!-color-blue", action.getIconClass()); action = BadgeAction.createBadge("symbol-star plugin-ionicons-api", "jenkins-!-color-red", "", null); assertEquals("icon-sm jenkins-!-color-red", action.getIconClass()); // teal is not in the palette