21128: moved toolbar test into project spec Arvados-DCO-1.1-Signed-off-by: Lisa Knox...
authorLisa Knox <lisaknox83@gmail.com>
Tue, 12 Dec 2023 15:25:53 +0000 (10:25 -0500)
committerLisa Knox <lisaknox83@gmail.com>
Tue, 12 Dec 2023 15:25:53 +0000 (10:25 -0500)
cypress/integration/multiselect-toolbar.spec.js
cypress/integration/project.spec.js
src/components/data-table/data-table.tsx

index 72df1e5d5134482eb9d4ee5af2d225bce4058295..4a37921520800464f5389c72d66db1d35713f954 100644 (file)
@@ -34,30 +34,4 @@ describe('Multiselect Toolbar Tests', () => {
         cy.get('[data-cy=multiselect-button]').should('not.exist');
         cy.get('[data-cy=multiselect-alt-button]').should('not.exist');
     });
-
-    it('can manipulate a project resource', () => {
-        cy.loginAs(activeUser);
-        const projName = `Test project (${Math.floor(999999 * Math.random())})`;
-        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.go('back')
-
-        cy.get('[data-cy=data-table-row]').contains(projName).should('exist').parent().parent().parent().click()
-        cy.get('[data-cy=multiselect-button]').should('have.length', 12).eq(3).trigger('mouseover');
-        cy.get('body').contains('Edit project').should('exist')
-        cy.get('[data-cy=multiselect-button]').eq(3).click()
-        cy.get("[data-cy=form-dialog]").within(() => {
-            cy.get("div[contenteditable=true]").click().type('this is a test');
-            cy.get("[data-cy=form-submit-btn]").click();
-        });
-    });
 });
index e4d7be87fb068df762c395048b6e4fac94133ad4..4ad6142ee765f50292e5d77afa567f17b55403c4 100644 (file)
@@ -180,6 +180,47 @@ describe("Project tests", function () {
         verifyProjectDescription(projName, null);
     });
 
+    it('shows the appropriate buttons in the multiselect toolbar', () => {
+
+        const msButtonTooltips = [
+            'API Details',
+            'Add to Favorites',
+            'Copy to clipboard',
+            'Edit project',
+            'Freeze Project',
+            'Move to',
+            'Move to trash',
+            'New project',
+            'Open in new tab',
+            'Open with 3rd party client',
+            'Share',
+            'View details',
+        ];
+
+        cy.loginAs(activeUser);
+        const projName = `Test project (${Math.floor(999999 * Math.random())})`;
+        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.go('back')
+
+        cy.get('[data-cy=data-table-row]').contains(projName).should('exist').parent().parent().parent().click()
+        cy.get('[data-cy=multiselect-button]').should('have.length', 12).eq(3)
+        for (let i = 0; i < 12; i++) {
+            cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseover');
+            cy.get('body').contains(msButtonTooltips[i]).should('exist')
+            cy.get('[data-cy=multiselect-button]').eq(i).trigger('mouseout');
+        }
+    })
+
     it("creates new project on home project and then a subproject inside it", function () {
         const createProject = function (name, parentName) {
             cy.get("[data-cy=side-panel-button]").click();
index 84d377bba13fb74ab89701a259f3615bf08d127b..97e1a3ac488caf6f0b260858b649c79df96a072e 100644 (file)
@@ -173,6 +173,7 @@ export const DataTable = withStyles(styles)(
                 const { classes, checkedList } = this.props;
                 return (
                     <input
+                        data-cy={`multiselect-checkbox-${uuid}`}
                         type="checkbox"
                         name={uuid}
                         className={classes.checkBox}
@@ -374,6 +375,7 @@ export const DataTable = withStyles(styles)(
             const { onRowClick, onRowDoubleClick, extractKey, classes, currentItemUuid, currentRoute } = this.props;
             return (
                 <TableRow
+                    data-cy={'data-table-row'}
                     hover
                     key={extractKey ? extractKey(item) : index}
                     onClick={event => onRowClick && onRowClick(event, item)}