Skip to content

Commit

Permalink
Adjust test
Browse files Browse the repository at this point in the history
  • Loading branch information
timja committed Dec 31, 2024
1 parent 5fd9f51 commit e1dff1a
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions test/src/test/java/lib/layout/IconTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,14 @@ public void testBallColorTd() throws Exception {
HtmlPage p = j.createWebClient().goTo("testBallColorTd");

DomElement ballColorAborted = p.getElementById("ballColorAborted");
List<DomElement> 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<DomElement> statusIconsList = StreamSupport.stream(statusIcons.getChildElements().spliterator(), false).collect(Collectors.toList());
List<DomElement> statusIconsList = StreamSupport.stream(statusIcons.getChildElements().spliterator(), false).toList();

assertIconToSvgOkay(statusIconsList.get(0).getFirstElementChild().getNextElementSibling(), "icon-user icon-xlg");

Expand Down Expand Up @@ -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()));
}
Expand Down

0 comments on commit e1dff1a

Please sign in to comment.