Demonstrate that `IconSet` doesn't reset attributes with ampersand
@@ -6,6 +6,7 @@ import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.not;
import java.util.Map;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
public class IconSetTest {
@@ -66,4 +67,16 @@ public class IconSetTest {
assertThat(symbol, not(containsString("tooltip")));
}
+
+ /**
+ * Culprit: https://github.com/jenkinsci/jenkins/blob/ab0bb8495819bd807a9211ac0df3f08e420226f1/core/src/main/java/org/jenkins/ui/icon/IconSet.java#L97=
+ * If the tooltip contains an ampersand symbol (&amp;), it won't be removed.
+ */
+ @Disabled("TODO see JENKINS-68805")
+ @Test
+ void getSymbol_notSettingTooltipDoesntAddTooltipAttribute_evenWithAmpersand() {
+ String symbol = IconSet.getSymbol("download", "Title", "With&Ampersand", "class1 class2", "", "id");
+
+ assertThat(symbol, not(containsString("tooltip")));
+ }
}
