+ cy.getAll('@testSourceCollection', '@testTargetCollection')
+ .then(function ([testSourceCollection, testTargetCollection]) {
+ cy.loginAs(activeUser);
+
+ cy.get('.layout-pane-primary')
+ .contains('Projects').click();
+
+ cy.addToFavorites(activeUser.token, activeUser.user.uuid, testTargetCollection.uuid);
+
+ cy.get('main').contains(testSourceCollection.name).click();
+ cy.get('[data-cy=collection-files-panel]').contains('bar');
+ cy.get('[data-cy=collection-files-panel]').find('input[type=checkbox]').click({ force: true });
+ 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-favourites-tree-picker]')
+ .find('i')
+ .click();
+
+ cy.get('[data-cy=projects-tree-favourites-tree-picker]')
+ .contains(testTargetCollection.name)
+ .click();
+
+ cy.get('[data-cy=form-submit-btn]').click();
+
+ cy.get('.layout-pane-primary')
+ .contains('Projects').click();
+
+ cy.get('main').contains(testTargetCollection.name).click();
+
+ cy.get('[data-cy=collection-files-panel]').contains('bar');
+ });
+ });
+
+ it('can copy collection to favorites', () => {
+ cy.createProject({
+ owningUser: adminUser,
+ targetUser: activeUser,
+ projectName: 'mySharedWritableProject',
+ canWrite: true,
+ addToFavorites: true
+ });
+ cy.createProject({
+ owningUser: adminUser,
+ targetUser: activeUser,
+ projectName: 'mySharedReadonlyProject',
+ canWrite: false,
+ addToFavorites: true
+ });
+ cy.createProject({
+ owningUser: activeUser,
+ projectName: 'myProject1',
+ addToFavorites: true
+ });