assertFalse(
("<html>" + tip + "</html>")
.equals(JvSwingUtils.wrapTooltip(true, tip)),
- "Text is only wrapped in HTML tags when it should be wrapped over lines");
+ "Text is only wrapped in HTML tags when it should be shortened/wrapped over lines");
}
/**
@Test(groups = { "Functional" })
public void testWrapTooltip_multilineShortText()
{
+ // <br>
String tip = "Now is the winter of our discontent<br>Made glorious summer by this sun of York";
assertEquals(JvSwingUtils.wrapTooltip(false, tip), tip,
"Text was not kept the same");
assertEquals(JvSwingUtils.wrapTooltip(true, tip),
"<html>" + tip + "</html>",
"Text was not simply wrapped in HTML");
+
+ // <br/>
+ tip = "Now is the winter of our discontent<br/>Made glorious summer by this sun of York";
+ assertEquals(JvSwingUtils.wrapTooltip(false, tip), tip,
+ "Text was not kept the same");
+ assertEquals(JvSwingUtils.wrapTooltip(true, tip),
+ "<html>" + tip + "</html>",
+ "Text was not simply wrapped in HTML");
}
/**
@Test(groups = { "Functional" })
public void testWrapTooltip_longText()
{
+ // 76 characters > 60
String tip = "Now is the winter of our discontent made glorious summer by this sun of York";
String expected = "<style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style>"
+ "<div class=\"ttip\">" + tip + "</div>";