X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d60eaaa5549bcd863d4d202aecc2368de1f00db6..efcea950b84b26c4cbbdf4df8fd5c88f6c846da9:/src/components/context-menu/context-menu.tsx

diff --git a/src/components/context-menu/context-menu.tsx b/src/components/context-menu/context-menu.tsx
index 4068251b..ecade812 100644
--- a/src/components/context-menu/context-menu.tsx
+++ b/src/components/context-menu/context-menu.tsx
@@ -32,7 +32,7 @@ export class ContextMenu extends React.PureComponent<ContextMenuProps> {
             transformOrigin={DefaultTransformOrigin}
             anchorOrigin={DefaultTransformOrigin}
             onContextMenu={this.handleContextMenu}>
-            <List dense>
+            <List data-cy='context-menu' dense>
                 {items.map((group, groupIndex) =>
                     <React.Fragment key={groupIndex}>
                         {group.map((item, actionIndex) =>
@@ -53,7 +53,11 @@ export class ContextMenu extends React.PureComponent<ContextMenuProps> {
                                             {item.name}
                                         </ListItemText>}
                                 </ListItem>)}
-                        {groupIndex < items.length - 1 && <Divider />}
+                        {
+                            items[groupIndex + 1] &&
+                            items[groupIndex + 1].length > 0 &&
+                            <Divider />
+                        }
                     </React.Fragment>)}
             </List>
         </Popover>;
