[arvados] updated: 2.7.0-6034-g5900a7d55b

git repository hosting git at public.arvados.org
Fri Feb 9 19:56:51 UTC 2024


Summary of changes:
 .../cypress/integration/details-card.spec.js       | 65 ++++++++++++++++++++++
 .../project-details-card/project-details-card.tsx  |  9 ++-
 2 files changed, 69 insertions(+), 5 deletions(-)
 create mode 100644 services/workbench2/cypress/integration/details-card.spec.js

       via  5900a7d55b0f569fae952ec69247fc177f86d370 (commit)
      from  63c5742cf2ca07c0068ab69affbfcf8e4f3f6d35 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 5900a7d55b0f569fae952ec69247fc177f86d370
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Fri Feb 9 14:56:47 2024 -0500

    21224: added user card test Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/cypress/integration/details-card.spec.js b/services/workbench2/cypress/integration/details-card.spec.js
new file mode 100644
index 0000000000..b237113ca9
--- /dev/null
+++ b/services/workbench2/cypress/integration/details-card.spec.js
@@ -0,0 +1,65 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+describe('Details Card tests', function () {
+    let activeUser;
+    let adminUser;
+
+    before(function () {
+        // Only set up common users once. These aren't set up as aliases because
+        // aliases are cleaned up after every test. Also it doesn't make sense
+        // to set the same users on beforeEach() over and over again, so we
+        // separate a little from Cypress' 'Best Practices' here.
+        cy.getUser('admin', 'Admin', 'User', true, true)
+            .as('adminUser')
+            .then(function () {
+                adminUser = this.adminUser;
+            });
+        cy.getUser('activeUser1', 'Active', 'User', false, true)
+            .as('activeUser')
+            .then(function () {
+                activeUser = this.activeUser;
+            });
+        cy.on('uncaught:exception', (err, runnable) => {
+            console.error(err);
+        });
+    });
+
+    beforeEach(function () {
+        cy.clearCookies();
+        cy.clearLocalStorage();
+    });
+
+    it('should display the user details card', () => {
+        cy.loginAs(adminUser);
+
+        cy.get('[data-cy=user-details-card]').should('be.visible');
+        cy.get('[data-cy=user-details-card]').contains(adminUser.user.full_name).should('be.visible');
+    });
+
+    it('should contain a context menu with the correct options', () => {
+        cy.loginAs(adminUser);
+
+        cy.get('[data-cy=kebab-icon]').should('be.visible').click();
+
+        //admin options
+        cy.get('[data-cy=context-menu]').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('API Details').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Account Settings').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Attributes').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Project').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Deactivate User').should('be.visible');
+
+        cy.loginAs(activeUser);
+
+        cy.get('[data-cy=kebab-icon]').should('be.visible').click();
+
+        //active user options
+        cy.get('[data-cy=context-menu]').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('API Details').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Account Settings').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Attributes').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Project').should('be.visible');
+    });
+});
diff --git a/services/workbench2/src/views-components/project-details-card/project-details-card.tsx b/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
index 270e9157d4..ad550a86e7 100644
--- a/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
+++ b/services/workbench2/src/views-components/project-details-card/project-details-card.tsx
@@ -239,7 +239,7 @@ const UserCard: React.FC<UserCardProps> = ({ classes, currentResource, handleCon
     const { fullName, uuid } = currentResource as UserResource & { fullName: string };
 
     return (
-        <Card className={classNames(classes.root, isSelected ? classes.selected : '')} onClick={()=>handleCardClick(uuid)}>
+        <Card className={classNames(classes.root, isSelected ? classes.selected : '')} onClick={()=>handleCardClick(uuid)} data-cy='user-details-card'>
             <CardHeader
                 className={classes.cardHeader}
                 title={
@@ -261,10 +261,10 @@ const UserCard: React.FC<UserCardProps> = ({ classes, currentResource, handleCon
                         )}
                         <Tooltip
                             title='More options'
-                            disableFocusListener
                         >
                             <IconButton
                                 aria-label='More options'
+                                data-cy='kebab-icon'
                                 onClick={(ev) => handleContextMenu(ev, currentResource as any, isAdmin)}
                             >
                                 <MoreVerticalIcon />
@@ -286,7 +286,7 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, fro
     };
 
     return (
-        <Card className={classNames(classes.root, isSelected ? classes.selected : '')} onClick={()=>handleCardClick(uuid)}>
+        <Card className={classNames(classes.root, isSelected ? classes.selected : '')} onClick={()=>handleCardClick(uuid)} data-cy='project-details-card'>
             <CardHeader
                 className={classes.cardHeader}
                 title={
@@ -320,13 +320,12 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, fro
                     <section className={classes.contextMenuSection}>
                         <Tooltip
                             title='More options'
-                            disableFocusListener
                         >
                             <IconButton
                                 aria-label='More options'
                                 onClick={(ev) => handleContextMenu(ev, currentResource as any, isAdmin)}
                             >
-                                <MoreVerticalIcon />
+                                <MoreVerticalIcon data-cy='kebab-icon' />
                             </IconButton>
                         </Tooltip>
                     </section>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list