18482: Fixed info icon issue and added cypress test 18482-Info-Button-for-projects-is-broken
authorDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Mon, 29 Nov 2021 17:06:24 +0000 (18:06 +0100)
committerDaniel Kutyła <daniel.kutyla@contractors.roche.com>
Mon, 29 Nov 2021 17:06:24 +0000 (18:06 +0100)
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>

cypress/integration/project.spec.js
src/views-components/main-content-bar/main-content-bar.tsx

index af2d93e3c605ec79f1538c9224ce09800489bbfd..1c1759523ea0243113d0dd41fcbecbcfe636b257 100644 (file)
@@ -179,4 +179,19 @@ describe('Project tests', function() {
             cy.get('[data-cy=not-found-page]').should('not.exist');
         });
     });
+
+    it('shows details panel when clicking on the info icon', () => {
+        cy.createGroup(activeUser.token, {
+            name: `Test root project ${Math.floor(Math.random() * 999999)}`,
+            group_class: 'project',
+        }).as('testRootProject').then(function(testRootProject) {
+            cy.loginAs(activeUser);
+
+            cy.get('[data-cy=side-panel-tree]').contains(testRootProject.name).click();
+
+            cy.get('[data-cy=additional-info-icon]').click();
+
+            cy.contains(testRootProject.uuid).should('exist');
+        });
+    });
 });
\ No newline at end of file
index 10ae1790da29cff215bb48de177f08bce707ad08..480150cb45daec040f12d05d27f3ccc3043cfdf6 100644 (file)
@@ -60,7 +60,7 @@ export const MainContentBar =
         buttonVisible: isButtonVisible(state),
         projectUuid: state.detailsPanel.resourceUuid,
     }), (dispatch) => ({
-            onDetailsPanelToggle: toggleDetailsPanel,
+            onDetailsPanelToggle: () => dispatch<any>(toggleDetailsPanel()),
             onRefreshButtonClick: (id) => {
                 dispatch<any>(loadSidePanelTreeProjects(id));
                 dispatch<any>(reloadProjectMatchingUuid([id]));
@@ -80,7 +80,7 @@ export const MainContentBar =
                             </Grid>
                             <Grid item>
                                 {props.buttonVisible && <Tooltip title="Additional Info">
-                                    <IconButton color="inherit" className={props.classes.infoTooltip} onClick={props.onDetailsPanelToggle}>
+                                    <IconButton data-cy="additional-info-icon" color="inherit" className={props.classes.infoTooltip} onClick={props.onDetailsPanelToggle}>
                                         <DetailsIcon />
                                     </IconButton>
                                 </Tooltip>}