testing in Bamboo; no problem locally
[jalview.git] / test / jalview / gui / SeqPanelTest.java
index 53b4259..7b75bfb 100644 (file)
@@ -60,6 +60,7 @@ public class SeqPanelTest
   @BeforeClass(alwaysRun = true)
   public void setUpJvOptionPane()
   {
+    Jalview.setSynchronous(true);
     JvOptionPane.setInteractiveMode(false);
     JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
   }
@@ -724,7 +725,6 @@ public class SeqPanelTest
     final int charWidth = alignFrame.getViewport().getCharWidth();
     assertTrue(charWidth > 0); // sanity check
     assertEquals(alignFrame.getViewport().getRanges().getStartRes(), 0);
-
     /*
      * mouse at top left of unwrapped panel
      */
@@ -765,7 +765,11 @@ public class SeqPanelTest
     SeqCanvas seqCanvas = alignFrame.alignPanel.getSeqPanel().seqCanvas;
     int w = seqCanvas.getWidth();
     // limited to number of whole columns, base 0
-    int expected = w / charWidth - 1;
+
+    int expected = w / charWidth;
+    expected = Math.min(
+            alignFrame.getViewport().getRanges().getEndRes(),
+            expected);
     int col = testee.findColumn(evt);
     assertEquals(col, expected);