JAL-3032 test updates to match change to implementation
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 23 Jul 2018 10:53:22 +0000 (11:53 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Mon, 23 Jul 2018 10:53:22 +0000 (11:53 +0100)
test/jalview/gui/JvSwingUtilsTest.java
test/jalview/gui/PopupMenuTest.java

index 5e65cc2..61c5c9b 100644 (file)
@@ -113,8 +113,8 @@ public class JvSwingUtilsTest
   public void testWrapTooltip_longText()
   {
     String tip = "Now is the winter of our discontent made glorious summer by this sun of York";
-    String expected = "<style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
-            + tip + "</p>";
+    String expected = "<style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style>"
+            + "<div class=\"ttip\">" + tip + " </div>";
     assertEquals("<html>" + expected + "</html>",
             JvSwingUtils.wrapTooltip(true, tip));
     assertEquals(expected, JvSwingUtils.wrapTooltip(false, tip));
index 6f60588..6d0422d 100644 (file)
@@ -196,8 +196,12 @@ public class PopupMenuTest
     testee.configureReferenceAnnotationsMenu(menu, seqs);
     assertTrue(menu.isEnabled());
     String s = MessageManager.getString("label.add_annotations_for");
-    String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
-            + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+    // String expected = "<html><style> p.ttip {width: 350; text-align: justify;
+    // word-wrap: break-word;}</style><p class=\"ttip\">"
+    // + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+    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>";
     assertEquals(expected, menu.getToolTipText());
   }
 
@@ -219,8 +223,11 @@ public class PopupMenuTest
     testee.configureReferenceAnnotationsMenu(menu, seqs);
     assertTrue(menu.isEnabled());
     String s = MessageManager.getString("label.add_annotations_for");
-    String expected = "<html><style> p.ttip {width: 350; text-align: justify; word-wrap: break-word;}</style><p class=\"ttip\">"
-            + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+    // String expected = "<html><style> p.ttip {width: 350; text-align: justify;
+    // word-wrap: break-word;}</style><p class=\"ttip\">"
+    // + s + "<br/>Jmol/secondary structure<br/>PDB/Temp</p></html>";
+    String expected = "<html><style> div.ttip {width:350px;white-space:pre-wrap;padding:2px;overflow-wrap:break-word;}</style>"
+            + "<div class=\"ttip\">Add annotations for<br/>Jmol/secondary structure<br/>PDB/Temp </div></html>";
     assertEquals(expected, menu.getToolTipText());
   }