[arvados] updated: 2.7.0-6518-g6066bf4dbe

git repository hosting git at public.arvados.org
Tue Apr 23 18:53:47 UTC 2024


Summary of changes:
 services/workbench2/cypress/e2e/details-card.cy.js |  23 +-
 .../workbench2/cypress/e2e/details-card.spec.js    | 261 ---------------------
 .../project-details-card/project-details-card.tsx  |   4 +-
 3 files changed, 20 insertions(+), 268 deletions(-)
 delete mode 100644 services/workbench2/cypress/e2e/details-card.spec.js

       via  6066bf4dbe319f85ab43f3c8d7b37495188526c6 (commit)
      from  d8f96fba6c5f1ee0533817ac1c489a09e09cf490 (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 6066bf4dbe319f85ab43f3c8d7b37495188526c6
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Tue Apr 23 14:51:11 2024 -0400

    21224: fixed chips collapse test Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/cypress/e2e/details-card.cy.js b/services/workbench2/cypress/e2e/details-card.cy.js
index f37e68a693..b070221333 100644
--- a/services/workbench2/cypress/e2e/details-card.cy.js
+++ b/services/workbench2/cypress/e2e/details-card.cy.js
@@ -135,7 +135,7 @@ describe('Project Details Card tests', function () {
         cy.get('[data-cy=form-dialog]').should('not.exist');
 
         for (let i = 0; i < msButtonTooltips.length; i++) {
-            cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseover');
+            cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseover', { force: true });
             cy.get('body').contains(msButtonTooltips[i]).should('exist');
             cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseout');
         }
@@ -190,12 +190,13 @@ describe('Project Details Card tests', function () {
         cy.get('[data-cy=project-details-card]').contains(projName).should('be.visible');
 
         //toggle description
+        //description is always visible, even when collapsed
+        cy.get('[data-cy=project-details-card]').contains(projDescription).should('be.visible');
         cy.get('[data-cy=project-details-card]').invoke('height').should('be.lt', 90);
         cy.get('[data-cy=toggle-description]').click();
         cy.waitForDom();
         cy.get('[data-cy=project-details-card]').invoke('height').should('be.gt', 91);
-        cy.get('[data-cy=project-details-card]').contains(projDescription).should('be.visible');
-        cy.get('[data-cy=toggle-description').click();
+        cy.get('[data-cy=toggle-description]').click();
         cy.waitForDom();
         cy.get('[data-cy=project-details-card]').invoke('height').should('be.lt', 90);
     });
@@ -225,14 +226,26 @@ describe('Project Details Card tests', function () {
 
         cy.get('[data-cy=form-submit-btn]').click();
 
+        //toggle chips
+        cy.get('[data-cy=project-details-card]').invoke('height').should('be.lt', 100);
+        cy.get('[data-cy=toggle-chips]').click();
+        cy.waitForDom();
+        cy.get('[data-cy=project-details-card]').invoke('height').should('be.gt', 101);
+        cy.get('[data-cy=toggle-chips').click();
+        cy.waitForDom();
+        cy.get('[data-cy=project-details-card]').invoke('height').should('be.lt', 100);
+
         //check for key/value pairs in project details card
         cy.get('[data-cy=project-details-card]').contains('Animal').should('be.visible');
         cy.get('[data-cy=project-details-card]').contains('Importance').should('be.visible').click();
         cy.waitForDom();
-        cy.window().then((win) =>
+        cy.window().then((win) => {
             win.navigator.clipboard.readText().then((text) => {
+                //wait is necessary due to known issue with cypress at 13.7.1
+                cy.wait(1000)
                 expect(text).to.match(new RegExp(`Importance: Critical`));
-            })
+                })
+            }
         );
     });
 });
diff --git a/services/workbench2/cypress/e2e/details-card.spec.js b/services/workbench2/cypress/e2e/details-card.spec.js
deleted file mode 100644
index 3fbfd97e22..0000000000
--- a/services/workbench2/cypress/e2e/details-card.spec.js
+++ /dev/null
@@ -1,261 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-describe('User 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');
-    });
-});
-
-describe('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', () => {
-        const adminProjName = `Test project (${Math.floor(999999 * Math.random())})`;
-        cy.loginAs(adminUser);
-
-        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();
-
-        //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('should toggle description display', () => {
-        const projName = `Test project (${Math.floor(999999 * Math.random())})`;
-        const projDescription = 'Lorem ipsum dolor sit amet, consectetur adipiscing vultures, 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');
-    });
-
-    it('should display key/value pairs', () => {
-        const projName = `Test project (${Math.floor(999999 * Math.random())})`;
-        cy.loginAs(adminUser);
-
-        // Create project wih key/value pairs
-        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=key-input]').should('be.visible').click().type('Animal');
-        cy.get('[data-cy=value-input]').should('be.visible').click().type('Dog');
-        cy.get('[data-cy=property-add-btn]').should('be.visible').click();
-
-        cy.get('[data-cy=key-input]').should('be.visible').click().type('Importance');
-        cy.get('[data-cy=value-input]').should('be.visible').click().type('Critical');
-        cy.get('[data-cy=property-add-btn]').should('be.visible').click();
-
-        cy.get('[data-cy=form-submit-btn]').click();
-
-        //check for key/value pairs in project details card
-        cy.get('[data-cy=project-details-card]').contains('Animal').should('be.visible');
-        cy.get('[data-cy=project-details-card]').contains('Importance').should('be.visible').click();
-        cy.waitForDom();
-        cy.window().then((win) =>
-            win.navigator.clipboard.readText().then((text) => {
-                expect(text).to.match(new RegExp(`Importance: Critical`));
-            })
-        );
-    });
-});
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 e620cca446..bcc0199713 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
@@ -352,8 +352,8 @@ const ProjectCard: React.FC<ProjectCardProps> = ({ classes, currentResource, fro
                         onClick={toggleProperties}
                         className={classes.descriptionToggle}
                     >
-                        <div className={classes.chipToggle}>
-                            <ExpandChevronRight data-cy="toggle-chips" expanded={showProperties} />
+                        <div className={classes.chipToggle} data-cy="toggle-chips">
+                            <ExpandChevronRight expanded={showProperties} />
                         </div>
                         <section className={classes.showMore}>
                             <Collapse

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list