JAL-4059 fixed a test that is now working as expected due to <br/>. Better calculatio...
authorBen Soares <b.soares@dundee.ac.uk>
Mon, 13 Nov 2023 19:51:40 +0000 (19:51 +0000)
committerBen Soares <b.soares@dundee.ac.uk>
Mon, 13 Nov 2023 19:51:40 +0000 (19:51 +0000)
src/jalview/gui/JvSwingUtils.java
test/jalview/gui/PopupMenuTest.java

index b6b993e..f0fd3a8 100644 (file)
@@ -95,7 +95,8 @@ public final class JvSwingUtils
           {
             continue;
           }
-          maxLengthExceeded = line.length() > 60;
+          String linetext = line.replaceAll("<[^>]+>", "");
+          maxLengthExceeded = linetext.length() > 60;
           if (sb.length() > 0)
           {
             sb.append(br);
index 7636bda..e4c6792 100644 (file)
@@ -199,9 +199,8 @@ public class PopupMenuTest
     testee.configureReferenceAnnotationsMenu(menu, seqs);
     assertTrue(menu.isEnabled());
     String s = MessageManager.getString("label.add_annotations_for");
-    String expected = "<html><style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style>"
-            + "<div class=\"ttip\">" + s
-            + "<br/>Jmol/secondary structure<br/>PDB/Temp </div></html>";
+    String expected = "<html>" + s
+            + "<br/>Jmol/secondary structure<br/>PDB/Temp</html>";
     assertEquals(expected, menu.getToolTipText());
   }