[ARVADOS-WORKBENCH2] updated: 1.4.1-358-gfcbcbbb9

Git user git at public.arvados.org
Tue Jun 2 22:16:54 UTC 2020


Summary of changes:
 cypress.json                                       |   4 +-
 cypress/integration/collection-panel.spec.js       | 120 +++++++++++++++++++++
 cypress/integration/side-panel.spec.js             |  78 ++++++++++++++
 cypress/support/commands.js                        |  53 ++++++++-
 package.json                                       |   3 +
 src/components/breadcrumbs/breadcrumbs.tsx         |   8 +-
 .../collection-panel-files.tsx                     |  22 ++--
 src/components/context-menu/context-menu.tsx       |   2 +-
 src/components/file-tree/file-tree-item.tsx        |   1 +
 src/components/file-tree/file-tree.tsx             |   2 +-
 src/components/icon/icon.tsx                       |  17 +++
 src/index.tsx                                      |  29 +++--
 src/store/context-menu/context-menu-actions.ts     |   8 +-
 src/store/resources/resources-reducer.ts           |   8 +-
 src/store/workbench/workbench-actions.ts           |   2 +-
 .../collection-panel-files.ts                      |  19 +++-
 .../action-sets/collection-action-set.ts           |  59 +++++-----
 .../action-sets/collection-files-action-set.ts     |  66 +++++++-----
 .../collection-files-item-action-set.ts            |  42 +++++---
 src/views-components/context-menu/context-menu.tsx |   3 +
 .../property-key-field.tsx                         |   2 +
 .../property-value-field.tsx                       |   2 +
 .../resource-properties-form.tsx                   |   2 +-
 .../side-panel-button/side-panel-button.tsx        |   8 +-
 src/views/collection-panel/collection-panel.tsx    |  92 +++++++++++-----
 yarn.lock                                          |  26 +++++
 26 files changed, 527 insertions(+), 151 deletions(-)
 create mode 100644 cypress/integration/collection-panel.spec.js
 create mode 100644 cypress/integration/side-panel.spec.js

       via  fcbcbbb978fbb0d381c23a2ac204940c1c80dda3 (commit)
       via  6ad3586e61737306f61a330eca545ca494f16304 (commit)
       via  78fc087578d042bfede52c1f0569d3afb758e3d5 (commit)
       via  d4efd52e7e68c739dad1095267b6c8f0bf4a40fa (commit)
       via  eac8deef3ffc5d5f63328c3fec23d624d27abbee (commit)
       via  8d99878303eb17172a55e151ef5aab32ca428c22 (commit)
       via  6f70ff0ea0f03cdcc6c563619ed723a6895535c7 (commit)
       via  ce0ff64f2b49090e595bf1a614d811b161fbbfbb (commit)
       via  4bed7c3d982b8d9198186a37a1edbdf746b1e0e2 (commit)
       via  fc898afbfa340c57062887083c96bc197fc283d0 (commit)
       via  4c6f753bed0deee685b469be0b399bd61d457de8 (commit)
       via  ca7a29e2ac03703afeff3248d1b909f42b89ab19 (commit)
       via  bc49fa261517a5027980570a903b6b6aa5c1f82a (commit)
       via  ee9dac4509683f2fbe5fda146bd9c18f4b765337 (commit)
       via  d8a3b5fdd6f606800e9b321acb3fca10c5183cb9 (commit)
      from  0cfd92ccb88a7cac4ff6d1645bbbe62386f4bb1b (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 fcbcbbb978fbb0d381c23a2ac204940c1c80dda3
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Tue Jun 2 19:14:19 2020 -0300

    16439: Adds SidePanelButton clickability tests.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/cypress/integration/side-panel.spec.js b/cypress/integration/side-panel.spec.js
new file mode 100644
index 00000000..95b56400
--- /dev/null
+++ b/cypress/integration/side-panel.spec.js
@@ -0,0 +1,78 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+describe('Side panel 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('user', 'Active', 'User', false, true)
+            .as('activeUser').then(function() {
+                activeUser = this.activeUser;
+            }
+        );
+    })
+
+    beforeEach(function() {
+        cy.clearCookies()
+        cy.clearLocalStorage()
+    })
+
+    it('enables the +NEW side panel button on users home project', function() {
+        cy.loginAs(activeUser);
+        cy.visit(`/projects/${activeUser.user.uuid}`);
+        cy.get('[data-cy=side-panel-button]')
+            .should('exist')
+            .and('not.be.disabled');
+    })
+
+    it('disables or enables the +NEW side panel button on depending on project permissions', function() {
+        cy.loginAs(activeUser);
+        [true, false].map(function(isWritable) {
+            cy.createGroup(adminUser.token, {
+                name: `Test ${isWritable ? 'writable' : 'read-only'} project`,
+                group_class: 'project',
+            }).as('sharedGroup').then(function() {
+                cy.createLink(adminUser.token, {
+                    name: isWritable ? 'can_write' : 'can_read',
+                    link_class: 'permission',
+                    head_uuid: this.sharedGroup.uuid,
+                    tail_uuid: activeUser.user.uuid
+                })
+                cy.visit(`/projects/${this.sharedGroup.uuid}`);
+                cy.get('[data-cy=side-panel-button]')
+                    .should('exist')
+                    .and(`${isWritable ? 'not.' : ''}be.disabled`);
+            })
+        })
+    })
+
+    it('disables the +NEW side panel button on appropriate sections', function() {
+        cy.loginAs(activeUser);
+        [
+            {url: '/shared-with-me', label: 'Shared with me'},
+            {url: '/public-favorites', label: 'Public Favorites'},
+            {url: '/favorites', label: 'My Favorites'},
+            {url: '/workflows', label: 'Workflows'},
+            {url: '/all_processes', label: 'All Processes'},
+            {url: '/trash', label: 'Trash'},
+        ].map(function(section) {
+            cy.visit(section.url);
+            cy.get('[data-cy=breadcrumb-first]')
+                .should('contain', section.label);
+            cy.get('[data-cy=side-panel-button]')
+                .should('exist')
+                .and('be.disabled');
+        })
+    })
+})
\ No newline at end of file
diff --git a/src/components/breadcrumbs/breadcrumbs.tsx b/src/components/breadcrumbs/breadcrumbs.tsx
index 20782330..8ed0f0c4 100644
--- a/src/components/breadcrumbs/breadcrumbs.tsx
+++ b/src/components/breadcrumbs/breadcrumbs.tsx
@@ -34,7 +34,7 @@ export interface BreadcrumbsProps {
 
 export const Breadcrumbs = withStyles(styles)(
     ({ classes, onClick, onContextMenu, items }: BreadcrumbsProps & WithStyles<CssRules>) =>
-    <Grid container alignItems="center" wrap="nowrap">
+    <Grid container data-cy='breadcrumbs' alignItems="center" wrap="nowrap">
     {
         items.map((item, index) => {
             const isLastItem = index === items.length - 1;
@@ -44,6 +44,12 @@ export const Breadcrumbs = withStyles(styles)(
                     {isFirstItem ? null : <IllegalNamingWarning name={item.label} />}
                     <Tooltip title={item.label}>
                         <Button
+                            data-cy={
+                                isFirstItem
+                                ? 'breadcrumb-first'
+                                : isLastItem
+                                    ? 'breadcrumb-last'
+                                    : false}
                             color="inherit"
                             className={isLastItem ? classes.currentItem : classes.item}
                             onClick={() => onClick(item)}
diff --git a/src/views-components/side-panel-button/side-panel-button.tsx b/src/views-components/side-panel-button/side-panel-button.tsx
index 5e547740..07784c5e 100644
--- a/src/views-components/side-panel-button/side-panel-button.tsx
+++ b/src/views-components/side-panel-button/side-panel-button.tsx
@@ -93,7 +93,7 @@ export const SidePanelButton = withStyles(styles)(
                 return <Toolbar>
                     <Grid container>
                         <Grid container item xs alignItems="center" justify="flex-start">
-                            <Button variant="contained" disabled={!enabled}
+                            <Button data-cy="side-panel-button" variant="contained" disabled={!enabled}
                                 color="primary" size="small" className={classes.button}
                                 aria-owns={anchorEl ? 'aside-menu-list' : undefined}
                                 aria-haspopup="true"
@@ -108,13 +108,13 @@ export const SidePanelButton = withStyles(styles)(
                                 onClose={this.handleClose}
                                 onClick={this.handleClose}
                                 transformOrigin={transformOrigin}>
-                                <MenuItem className={classes.menuItem} onClick={this.handleNewCollectionClick}>
+                                <MenuItem data-cy='side-panel-new-collection' className={classes.menuItem} onClick={this.handleNewCollectionClick}>
                                     <CollectionIcon className={classes.icon} /> New collection
                                 </MenuItem>
-                                <MenuItem className={classes.menuItem} onClick={this.handleRunProcessClick}>
+                                <MenuItem data-cy='side-panel-run-process' className={classes.menuItem} onClick={this.handleRunProcessClick}>
                                     <ProcessIcon className={classes.icon} /> Run a process
                                 </MenuItem>
-                                <MenuItem className={classes.menuItem} onClick={this.handleNewProjectClick}>
+                                <MenuItem data-cy='side-panel-new-project' className={classes.menuItem} onClick={this.handleNewProjectClick}>
                                     <ProjectIcon className={classes.icon} /> New project
                                 </MenuItem>
                             </Menu>

commit 6ad3586e61737306f61a330eca545ca494f16304
Merge: 0cfd92cc 78fc0875
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Tue Jun 2 16:14:27 2020 -0300

    16439: Merge branch 'master' into 16439-objects-creation-placement-fix
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>


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


hooks/post-receive
-- 




More information about the arvados-commits mailing list