From 68f626871df2f0c70b76937137d99f464a7350ec Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Sat, 11 May 2024 09:58:41 -0600 Subject: [PATCH] Check link with leading / --- .../jenkinsci/plugins/badge/action/BadgeActionTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/test/java/com/jenkinsci/plugins/badge/action/BadgeActionTest.java b/src/test/java/com/jenkinsci/plugins/badge/action/BadgeActionTest.java index e1ce5db..6a8eb0e 100644 --- a/src/test/java/com/jenkinsci/plugins/badge/action/BadgeActionTest.java +++ b/src/test/java/com/jenkinsci/plugins/badge/action/BadgeActionTest.java @@ -123,6 +123,14 @@ void createShortText(@SuppressWarnings("unused") JenkinsRule r) { assertEquals("", action.getUrlName()); } + @Test + void createShortTextWithAllArgs(@SuppressWarnings("unused") JenkinsRule r) { + BadgeAction action = BadgeAction.createShortText("Short text badge", "red", "black", "blue", "green", "/link"); + assertEquals("/link", action.getLink()); + assertNull(action.getIconFileName()); + assertTrue(action.isTextOnly()); + } + @Test void createBadgeWithInvalidLink(@SuppressWarnings("unused") JenkinsRule r) { String invalidLink = "invalid-link";