Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
mawinter69 committed Aug 6, 2023
1 parent 2c0fedf commit 512c41b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/src/test/java/lib/form/HeteroListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
import org.htmlunit.html.HtmlButton;
import org.htmlunit.html.HtmlElementUtil;
import org.htmlunit.html.HtmlPage;
import org.htmlunit.javascript.host.html.HTMLAnchorElement;
import org.htmlunit.javascript.host.html.HTMLButtonElement;
import org.jenkinsci.Symbol;
import org.junit.Rule;
import org.junit.Test;
Expand All @@ -75,9 +75,9 @@ public void xssPrevented_heteroList_usingDescriptorDisplayName() throws Exceptio
HtmlPage page = wc.goTo("root");

page.executeJavaScript("document.querySelector('.hetero-list-add').click();");
Object result = page.executeJavaScript("document.querySelector('.yuimenuitem a')").getJavaScriptResult();
assertThat(result, instanceOf(HTMLAnchorElement.class));
HTMLAnchorElement menuItem = (HTMLAnchorElement) result;
Object result = page.executeJavaScript("document.querySelector('button .jenkins-dropdown__item')").getJavaScriptResult();
assertThat(result, instanceOf(HTMLButtonElement.class));
HTMLButtonElement menuItem = (HTMLButtonElement) result;
String menuItemContent = menuItem.getInnerHTML();
assertThat(menuItemContent, not(containsString("<")));
}
Expand Down

0 comments on commit 512c41b

Please sign in to comment.