JAL-1858 updated unit test asserts
[jalview.git] / test / jalview / viewmodel / ViewportRangesTest.java
index 74cd8f9..851b1b7 100644 (file)
@@ -13,6 +13,7 @@ import jalview.datamodel.HiddenSequences;
 import java.beans.PropertyChangeEvent;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
 import java.util.List;
 
 import org.testng.annotations.BeforeClass;
@@ -534,9 +535,16 @@ public class ViewportRangesTest {
             Arrays.asList("startseq", "startseq", "startseq", "startseq")));
     l.reset();
 
-    vr.scrollToWrappedVisible(5);
-    assertTrue(l.verify(1, Arrays.asList("startres")));
+    /*
+     * scrollToWrappedVisible does nothing if the target position is
+     * within the current startRes-endRes range
+     */
+    assertFalse(vr.scrollToWrappedVisible(5));
+    assertTrue(l.verify(0, Collections.<String> emptyList()));
     l.reset();
+
+    vr.scrollToWrappedVisible(25);
+    assertTrue(l.verify(1, Arrays.asList("startres")));
   }
 
   @Test(groups = { "Functional" })