Merge branch '17308-property-editor-fixes'
authorLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 3 Feb 2021 19:50:00 +0000 (16:50 -0300)
committerLucas Di Pentima <lucas@di-pentima.com.ar>
Wed, 3 Feb 2021 19:50:00 +0000 (16:50 -0300)
Closes #17308

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas@di-pentima.com.ar>

1  2 
cypress/integration/collection.spec.js

index 44e55c34e7740c150773c53e03f9523905be807a,67df16ab93ba35ff8cd6a46c0dd245d91bfa1e83..8db574ce9ff473201adc5b7e81f4e2002cc6a8f9
@@@ -38,7 -38,7 +38,7 @@@ describe('Collection panel tests', func
              cy.doSearch(`${this.testCollection.uuid}`);
  
              // Key: Color (IDTAGCOLORS) - Value: Magenta (IDVALCOLORS3)
-             cy.get('[data-cy=collection-properties-form]').within(() => {
+             cy.get('[data-cy=resource-properties-form]').within(() => {
                  cy.get('[data-cy=property-field-key]').within(() => {
                      cy.get('input').type('Color');
                  });
      it('shows collection by URL', function() {
          cy.loginAs(activeUser);
          [true, false].map(function(isWritable) {
 +            // Using different file names to avoid test flakyness: the second iteration
 +            // on this loop may pass an assertion from the first iteration by looking
 +            // for the same file name.
 +            const fileName = isWritable ? 'bar' : 'foo';
              cy.createGroup(adminUser.token, {
                  name: 'Shared project',
                  group_class: 'project',
@@@ -78,7 -74,7 +78,7 @@@
                      name: 'Test collection',
                      owner_uuid: this.sharedGroup.uuid,
                      properties: {someKey: 'someValue'},
 -                    manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"})
 +                    manifest_text: `. 37b51d194a7513e45b56f6524f2d51f2+3 0:3:${fileName}\n`})
                  .as('testCollection').then(function() {
                      // Share the group with active user.
                      cy.createLink(adminUser.token, {
                          .and('not.contain', 'anotherValue')
                      if (isWritable === true) {
                          // Check that properties can be added.
-                         cy.get('[data-cy=collection-properties-form]').within(() => {
+                         cy.get('[data-cy=resource-properties-form]').within(() => {
                              cy.get('[data-cy=property-field-key]').within(() => {
                                  cy.get('input').type('anotherKey');
                              });
                              .and('contain', 'anotherValue')
                      } else {
                          // Properties form shouldn't be displayed.
-                         cy.get('[data-cy=collection-properties-form]').should('not.exist');
+                         cy.get('[data-cy=resource-properties-form]').should('not.exist');
                      }
                      // Check that the file listing show both read & write operations
                      cy.get('[data-cy=collection-files-panel]').within(() => {
 -                        cy.root().should('contain', 'bar');
 +                        cy.root().should('contain', fileName);
                          if (isWritable) {
                              cy.get('[data-cy=upload-button]')
                                  .should(`${isWritable ? '' : 'not.'}contain`, 'Upload data');
                          }
                      });
                      cy.get('[data-cy=collection-files-panel]')
 -                        .contains('bar').rightclick();
 +                        .contains(fileName).rightclick();
                      cy.get('[data-cy=context-menu]')
                          .should('contain', 'Download')
                          .and('contain', 'Open in new tab')
                  .should('contain', 'foo').and('contain', 'bar');
          });
      });
+     it('creates new collection on home project', function() {
+         cy.loginAs(activeUser);
+         cy.doSearch(`${activeUser.user.uuid}`);
+         cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
+         cy.get('[data-cy=breadcrumb-last]').should('not.exist');
+         // Create new collection
+         cy.get('[data-cy=side-panel-button]').click();
+         cy.get('[data-cy=side-panel-new-collection]').click();
+         const collName = `Test collection (${Math.floor(999999 * Math.random())})`;
+         cy.get('[data-cy=form-dialog]')
+             .should('contain', 'New collection')
+             .within(() => {
+                 cy.get('[data-cy=parent-field]').within(() => {
+                     cy.get('input').should('have.value', 'Home project');
+                 })
+                 cy.get('[data-cy=name-field]').within(() => {
+                     cy.get('input').type(collName);
+                 })
+             })
+         cy.get('[data-cy=form-submit-btn]').click();
+         // Confirm that the user was taken to the newly created thing
+         cy.get('[data-cy=form-dialog]').should('not.exist');
+         cy.get('[data-cy=breadcrumb-first]').should('contain', 'Projects');
+         cy.get('[data-cy=breadcrumb-last]').should('contain', collName);
+     });
  })