Skip to content

Commit 46e46cd

Browse files
committed
Test that links show up when not in an item.
1 parent e7f4487 commit 46e46cd

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/test/java/org/jenkinsci/plugins/workflow/cps/SnippetizerTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,5 +376,18 @@ public void snippetizerLinks() throws Exception {
376376
containsString("href=\"https://jenkins.io/doc/pipeline/\""));
377377
assertThat("GDSL link is included", html,
378378
containsString("href=\"" + r.contextPath + "/" + job.getUrl() + Snippetizer.ACTION_URL + "/gdsl\""));
379+
380+
// Now verify that the links are still present and correct when we're not within a job.
381+
String rootHtml = wc.goTo(Snippetizer.ACTION_URL).getWebResponse().getContentAsString();
382+
assertThat("Snippet Generator link is included", rootHtml,
383+
containsString("href=\"" + r.contextPath + "/" + Snippetizer.ACTION_URL + "\""));
384+
assertThat("Steps Reference link is included", rootHtml,
385+
containsString("href=\"" + r.contextPath + "/" + Snippetizer.ACTION_URL + "/html\""));
386+
assertThat("Globals Reference link is included", rootHtml,
387+
containsString("href=\"" + r.contextPath + "/" + Snippetizer.ACTION_URL + "/globals\""));
388+
assertThat("Online docs link is included", rootHtml,
389+
containsString("href=\"https://jenkins.io/doc/pipeline/\""));
390+
assertThat("GDSL link is included", rootHtml,
391+
containsString("href=\"" + r.contextPath + "/" + Snippetizer.ACTION_URL + "/gdsl\""));
379392
}
380393
}

0 commit comments

Comments
 (0)