JAL-2282 Link menu disabled if there are no valid links
[jalview.git] / test / jalview / gui / PopupMenuTest.java
index 7b1eac1..14354ff 100644 (file)
@@ -534,6 +534,16 @@ public class PopupMenuTest
               ((JMenuItem) linkItems[i]).getText().split("\\|")[1]);
     }
 
+    // if there are no valid links the Links submenu is disabled
+    List<String> nomatchlinks = new ArrayList<String>();
+    nomatchlinks.add("NOMATCH | http://www.uniprot.org/uniprot/$"
+            + DB_ACCESSION + "$");
+
+    testee = new PopupMenu(parentPanel, (Sequence) seqs.get(0),
+            nomatchlinks);
+    seqItems = testee.sequenceMenu.getMenuComponents();
+    linkMenu = (JMenu) seqItems[6];
+    assertFalse(linkMenu.isEnabled());
 
   }
 }