From: Lucas Di Pentima Date: Tue, 14 Dec 2021 19:12:14 +0000 (-0300) Subject: 18584: Adds Cypress test for collection copy action. X-Git-Tag: 2.4.0~24^2~5 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/3971518483964a5c789eea29f7a199ebd99bdce3 18584: Adds Cypress test for collection copy action. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js index eb06a06c..0ff26706 100644 --- a/cypress/integration/collection.spec.js +++ b/cypress/integration/collection.spec.js @@ -595,6 +595,39 @@ describe('Collection panel tests', function () { }) }); + it('makes a copy of an existing collection', function() { + const collName = `Test Collection ${Math.floor(Math.random() * 999999)}`; + const copyName = `Copy of: ${collName}`; + + cy.createCollection(adminUser.token, { + name: collName, + owner_uuid: activeUser.user.uuid, + manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:some-file\n", + }).as('collection').then(function () { + cy.loginAs(activeUser) + cy.goToPath(`/collections/${this.collection.uuid}`); + cy.get('[data-cy=collection-files-panel]') + .should('contain', 'some-file'); + cy.get('[data-cy=collection-panel-options-btn]').click(); + cy.get('[data-cy=context-menu]').contains('Make a copy').click(); + cy.get('[data-cy=form-dialog]') + .should('contain', 'Make a copy') + .within(() => { + cy.get('[data-cy=projects-tree-home-tree-picker]') + .contains('Projects') + .click(); + cy.get('[data-cy=form-submit-btn]').click(); + }); + cy.get('[data-cy=snackbar]') + .contains('Collection has been copied.') + cy.get('[data-cy=snackbar-goto-action]').click(); + cy.get('[data-cy=project-panel]') + .contains(copyName).click(); + cy.get('[data-cy=collection-files-panel]') + .should('contain', 'some-file'); + }); + }); + it('uses the collection version browser to view a previous version', function () { const colName = `Test Collection ${Math.floor(Math.random() * 999999)}`; diff --git a/src/views-components/projects-tree-picker/projects-tree-picker.tsx b/src/views-components/projects-tree-picker/projects-tree-picker.tsx index 2f3ea611..ee8ce1d5 100644 --- a/src/views-components/projects-tree-picker/projects-tree-picker.tsx +++ b/src/views-components/projects-tree-picker/projects-tree-picker.tsx @@ -31,11 +31,17 @@ export const ProjectsTreePicker = ({ pickerId, ...props }: ProjectsTreePickerPro disableActivation }; return
- - - +
+ +
+
+ +
+
+ +
- +
; }; diff --git a/src/views-components/snackbar/snackbar.tsx b/src/views-components/snackbar/snackbar.tsx index 2a63a31a..a33b6968 100644 --- a/src/views-components/snackbar/snackbar.tsx +++ b/src/views-components/snackbar/snackbar.tsx @@ -116,7 +116,7 @@ export const Snackbar = withStyles(styles)(connect(mapStateToProps, mapDispatchT onExited={props.onExited} anchorOrigin={props.anchorOrigin} autoHideDuration={props.autoHideDuration}> - } action={actions(props)} - /> + /> ); } @@ -151,7 +151,7 @@ const actions = (props: SnackbarProps) => { color="inherit" className={classes.linkButton} onClick={() => onClick(link)}> - Go To + Go To ); } diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx index 97f79517..4a3f60a6 100644 --- a/src/views/project-panel/project-panel.tsx +++ b/src/views/project-panel/project-panel.tsx @@ -145,7 +145,7 @@ export const ProjectPanel = withStyles(styles)( class extends React.Component { render() { const { classes } = this.props; - return
+ return