[arvados] updated: 2.7.0-6035-g67434b4548

git repository hosting git at public.arvados.org
Mon Feb 12 15:49:15 UTC 2024


Summary of changes:
 .../cypress/integration/details-card.spec.js       | 149 ++++++++++++++++++++-
 .../project-details-card/project-details-card.tsx  |   5 +-
 2 files changed, 151 insertions(+), 3 deletions(-)

       via  67434b45485a5660431f0be0b9c55533d3dad729 (commit)
      from  5900a7d55b0f569fae952ec69247fc177f86d370 (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 67434b45485a5660431f0be0b9c55533d3dad729
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Mon Feb 12 10:49:06 2024 -0500

    21224: project card context and description tests up 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
index b237113ca9..6290b4c740 100644
--- a/services/workbench2/cypress/integration/details-card.spec.js
+++ b/services/workbench2/cypress/integration/details-card.spec.js
@@ -2,7 +2,7 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-describe('Details Card tests', function () {
+describe('User Details Card tests', function () {
     let activeUser;
     let adminUser;
 
@@ -63,3 +63,150 @@ describe('Details Card tests', function () {
         cy.get('[data-cy=context-menu]').contains('Project').should('be.visible');
     });
 });
+
+describe.only('Project 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 project details card', () => {
+        const projName = `Test project (${Math.floor(999999 * Math.random())})`;
+        cy.loginAs(adminUser);
+
+        // Create project
+        cy.get('[data-cy=side-panel-button]').click();
+        cy.get('[data-cy=side-panel-new-project]').click();
+        cy.get('[data-cy=form-dialog]')
+            .should('contain', 'New Project')
+            .within(() => {
+                cy.get('[data-cy=name-field]').within(() => {
+                    cy.get('input').type(projName);
+                });
+            });
+        cy.get('[data-cy=form-submit-btn]').click();
+        cy.get('[data-cy=form-dialog]').should('not.exist');
+
+        cy.get('[data-cy=project-details-card]').should('be.visible');
+        cy.get('[data-cy=project-details-card]').contains(projName).should('be.visible');
+    });
+
+    it ('should contain a context menu with the correct options', () => {
+        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('Copy to clipboard').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Edit project').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Move to').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('New project').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Open in new tab').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Open with 3rd party client').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Share').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Add to favorites').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Freeze project').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Add to public favorites').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Move to trash').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('View details').should('be.visible');
+
+        //create project
+        const projName = `Test project (${Math.floor(999999 * Math.random())})`;
+        cy.loginAs(activeUser);
+
+        cy.get('[data-cy=side-panel-button]').click();
+        cy.get('[data-cy=side-panel-new-project]').click();
+        cy.get('[data-cy=form-dialog]')
+            .should('contain', 'New Project')
+            .within(() => {
+                cy.get('[data-cy=name-field]').within(() => {
+                    cy.get('input').type(projName);
+                });
+            });
+        cy.get('[data-cy=form-submit-btn]').click();
+
+        cy.waitForDom()
+        cy.get('[data-cy=kebab-icon]').should('be.visible').click({ force: true });
+
+        //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('Copy to clipboard').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Edit project').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Move to').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('New project').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Open in new tab').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Open with 3rd party client').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Share').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Add to favorites').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Freeze project').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('Move to trash').should('be.visible');
+        cy.get('[data-cy=context-menu]').contains('View details').should('be.visible');
+
+    });
+
+    it.only('should toggle description display', () => {
+
+      const projName = `Test project (${Math.floor(999999 * Math.random())})`;
+      const projDescription = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, whose wings are dull realities.';
+      cy.loginAs(adminUser);
+
+      // Create project
+      cy.get('[data-cy=side-panel-button]').click();
+      cy.get('[data-cy=side-panel-new-project]').click();
+      cy.get('[data-cy=form-dialog]')
+          .should('contain', 'New Project')
+          .within(() => {
+              cy.get('[data-cy=name-field]').within(() => {
+                  cy.get('input').type(projName);
+              });
+          });
+      cy.get('[data-cy=form-submit-btn]').click();
+
+      //check for no description
+      cy.get("[data-cy=no-description").should('be.visible');
+
+      //add description
+      cy.get("[data-cy=side-panel-tree]").contains("Home Projects").click();
+      cy.get("[data-cy=project-panel] tbody tr").contains(projName).rightclick({ force: true });
+      cy.get("[data-cy=context-menu]").contains("Edit").click();
+      cy.get("[data-cy=form-dialog]").within(() => {
+          cy.get("div[contenteditable=true]").click().type(projDescription);
+          cy.get("[data-cy=form-submit-btn]").click();
+      });
+      cy.get("[data-cy=project-panel] tbody tr").contains(projName).click({ force: true });
+      cy.get('[data-cy=project-details-card]').contains(projName).should('be.visible');
+
+      //toggle description
+      cy.get("[data-cy=toggle-description").click();
+      cy.waitForDom();
+      cy.get("[data-cy=project-description]").should('be.visible');
+      cy.get("[data-cy=project-details-card]").contains(projDescription).should('be.visible');
+      cy.get("[data-cy=toggle-description").click();
+      cy.waitForDom();
+      cy.get("[data-cy=project-description]").should('be.hidden');
+    });
+});
\ No newline at end of file
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 ad550a86e7..423cf3aebf 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
@@ -348,17 +348,18 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, fro
                             <Typography
                                 className={classes.showMore}
                                 onClick={toggleDescription}
+                                data-cy='toggle-description'
                             >
                                 {!showDescription ? "Show full description" : "Hide full description"}
                             </Typography>
                         ) : (
-                            <Typography className={classes.noDescription}>no description available</Typography>
+                            <Typography className={classes.noDescription} data-cy="no-description">no description available</Typography>
                         )}
                     </section>
                 </section>
                 <Collapse in={showDescription} timeout='auto'>
                     <section onClick={(ev)=>ev.stopPropagation()}>
-                        <Typography className={classes.description}>
+                        <Typography className={classes.description} data-cy='project-description'>
                             {description}
                         </Typography>
                     </section>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list