[ARVADOS-WORKBENCH2] created: 2.3.0-134-gfeb9e110

Git user git at public.arvados.org
Thu Jan 13 21:22:40 UTC 2022


        at  feb9e1106e2337dade4c338f99abbd7cf50c2100 (commit)


commit feb9e1106e2337dade4c338f99abbd7cf50c2100
Author: Lucas Di Pentima <lucas.dipentima at curii.com>
Date:   Thu Jan 13 17:58:07 2022 -0300

    18587: Adds test exposing 'Copy selected into the collection' misbehavior.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima at curii.com>

diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js
index 51933887..dfa9a420 100644
--- a/cypress/integration/collection.spec.js
+++ b/cypress/integration/collection.spec.js
@@ -965,5 +965,69 @@ describe('Collection panel tests', function () {
                     });
                 });
         });
+
+        it('can copy selected files into a preexisting collection', () => {
+            cy.createCollection(adminUser.token, {
+                owner_uuid: activeUser.user.uuid,
+                name: `Test source collection ${Math.floor(Math.random() * 999999)}`,
+                manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:File1 0:3:File2\n"
+            }).as('testSourceCollection');
+
+            cy.createCollection(adminUser.token, {
+                owner_uuid: activeUser.user.uuid,
+                name: `Test target collection ${Math.floor(Math.random() * 999999)}`,
+            }).as('testTargetCollection');
+
+            cy.getAll('@testSourceCollection', '@testTargetCollection')
+                .then(function ([testSourceCollection, testTargetCollection]) {
+                    cy.loginAs(activeUser);
+                    cy.get('[data-cy=project-panel]').contains(testSourceCollection.name).click();
+                    cy.get('[data-cy=collection-files-panel]').should('contain', 'File1');
+                    cy.get('[data-cy=collection-files-panel]').should('contain', 'File2');
+                    // Copy the 1st file
+                    cy.get('[data-cy=collection-files-panel]')
+                        .get('input[type=checkbox]').eq(0)
+                        .click();
+                    cy.get('[data-cy=collection-files-panel-options-btn]')
+                        .click();
+                    cy.get('[data-cy=context-menu]')
+                        .contains('Copy selected into the collection')
+                        .click();
+                    cy.get('[data-cy=projects-tree-home-tree-picker]')
+                        .find('i').click();
+                    cy.get('[data-cy=projects-tree-home-tree-picker]')
+                        .contains(testTargetCollection.name).click();
+                    cy.get('[data-cy=form-submit-btn]').click();
+                    // Confirm file copy on target collection
+                    cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
+                    cy.get('[data-cy=project-panel]').contains(testTargetCollection.name).click();
+                    cy.get('[data-cy=collection-files-panel]').should('contain', 'File1');
+                    cy.get('[data-cy=collection-files-panel]').should('not.contain', 'File2');
+                    // Confirm source collection state
+                    cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
+                    cy.get('[data-cy=project-panel]').contains(testSourceCollection.name).click();
+                    cy.get('[data-cy=collection-files-panel]').should('contain', 'File1');
+                    cy.get('[data-cy=collection-files-panel]').should('contain', 'File2');
+                    // Copy the 2nd file
+                    cy.get('[data-cy=collection-files-panel]')
+                        .get('input[type=checkbox]').eq(1)
+                        .click();
+                    cy.get('[data-cy=collection-files-panel-options-btn]')
+                        .click();
+                    cy.get('[data-cy=context-menu]')
+                        .contains('Copy selected into the collection')
+                        .click();
+                    cy.get('[data-cy=projects-tree-home-tree-picker]')
+                        .find('i').click();
+                    cy.get('[data-cy=projects-tree-home-tree-picker]')
+                        .contains(testTargetCollection.name).click();
+                    cy.get('[data-cy=form-submit-btn]').click();
+                    // Confirm file copy on target collection
+                    cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
+                    cy.get('[data-cy=project-panel]').contains(testTargetCollection.name).click();
+                    cy.get('[data-cy=collection-files-panel]').should('contain', 'File1');
+                    cy.get('[data-cy=collection-files-panel]').should('contain', 'File2');
+                });
+        });
     });
 })
diff --git a/cypress/integration/favorites.spec.js b/cypress/integration/favorites.spec.js
index 9bc90ebd..13a2c467 100644
--- a/cypress/integration/favorites.spec.js
+++ b/cypress/integration/favorites.spec.js
@@ -44,8 +44,7 @@ describe('Favorites tests', function () {
         });
     });
 
-    // Disabled while addressing #18587
-    it.skip('can copy selected into the collection', () => {
+    it('can copy selected into the collection', () => {
         cy.createCollection(adminUser.token, {
             name: `Test source collection ${Math.floor(Math.random() * 999999)}`,
             manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
diff --git a/src/views-components/context-menu/action-sets/collection-files-action-set.ts b/src/views-components/context-menu/action-sets/collection-files-action-set.ts
index f34f2868..0d3219c3 100644
--- a/src/views-components/context-menu/action-sets/collection-files-action-set.ts
+++ b/src/views-components/context-menu/action-sets/collection-files-action-set.ts
@@ -6,8 +6,7 @@ import { ContextMenuActionSet } from "views-components/context-menu/context-menu
 import { collectionPanelFilesAction, openMultipleFilesRemoveDialog } from "store/collection-panel/collection-panel-files/collection-panel-files-actions";
 import {
     openCollectionPartialCopyDialog,
-    // Disabled while addressing #18587
-    // openCollectionPartialCopyToSelectedCollectionDialog
+    openCollectionPartialCopyToSelectedCollectionDialog,
 } from 'store/collections/collection-partial-copy-actions';
 
 // These action sets are used on the multi-select actions button.
@@ -30,13 +29,12 @@ export const readOnlyCollectionFilesActionSet: ContextMenuActionSet = [[
             dispatch<any>(openCollectionPartialCopyDialog());
         }
     },
-    // Disabled while addressing #18587
-    // {
-    //     name: "Copy selected into the collection",
-    //     execute: dispatch => {
-    //         dispatch<any>(openCollectionPartialCopyToSelectedCollectionDialog());
-    //     }
-    // }
+    {
+        name: "Copy selected into the collection",
+        execute: dispatch => {
+            dispatch<any>(openCollectionPartialCopyToSelectedCollectionDialog());
+        }
+    }
 ]];
 
 export const collectionFilesActionSet: ContextMenuActionSet = readOnlyCollectionFilesActionSet.concat([[

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list