diff --git a/core/src/main/resources/lib/hudson/ballColorTd.jelly b/core/src/main/resources/lib/hudson/ballColorTd.jelly index 9cbefdf3d43f..2fd299d2e496 100644 --- a/core/src/main/resources/lib/hudson/ballColorTd.jelly +++ b/core/src/main/resources/lib/hudson/ballColorTd.jelly @@ -24,9 +24,9 @@ THE SOFTWARE. - Display the ball in a TD. - - Color of the ball or null to skip drawing. + Display the build status icon in a table cell. + + Icon to be displayed. Specifies the size of the icon. If unspecified, it inherits from @@ -56,33 +56,42 @@ THE SOFTWARE. - - - - - - - - - - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + diff --git a/test/src/test/java/lib/layout/IconTest.java b/test/src/test/java/lib/layout/IconTest.java index 033d8f161a7e..ef5043ee4309 100644 --- a/test/src/test/java/lib/layout/IconTest.java +++ b/test/src/test/java/lib/layout/IconTest.java @@ -93,11 +93,14 @@ public void testBallColorTd() throws Exception { HtmlPage p = j.createWebClient().goTo("testBallColorTd"); DomElement ballColorAborted = p.getElementById("ballColorAborted"); - List ballIcons = StreamSupport.stream(ballColorAborted.getChildElements().spliterator(), false).collect(Collectors.toList()); - assertIconToSvgIconOkay(ballIcons.get(0).getFirstElementChild(), "icon-aborted icon-md"); + assertThat("Aborted", is(ballColorAborted.getTextContent())); + HtmlElement symbol = ballColorAborted.getElementsByTagName("svg").get(0); + assertThat("icon-md", is(symbol.getAttribute("class"))); + + assertIconToSymbolOkay(symbol); DomElement statusIcons = p.getElementById("statusIcons"); - List statusIconsList = StreamSupport.stream(statusIcons.getChildElements().spliterator(), false).collect(Collectors.toList()); + List statusIconsList = StreamSupport.stream(statusIcons.getChildElements().spliterator(), false).toList(); assertIconToSvgOkay(statusIconsList.get(0).getFirstElementChild().getNextElementSibling(), "icon-user icon-xlg"); @@ -182,13 +185,6 @@ private void assertIconToSvgOkay(DomElement icon, String classSpec) { } } - private void assertIconToSvgIconOkay(DomElement icon, String classSpec) { - assertThat(icon.getTagName(), is("span")); - if (classSpec != null) { - assertThat(icon.getAttribute("class"), endsWith(classSpec)); - } - } - private void assertIconToSymbolOkay(DomElement icon) { assertThat("svg", is(icon.getTagName())); }