19153: Fix project cypress test
[arvados-workbench2.git] / cypress / integration / search.spec.js
index 403516b324f4b78084103fc94c7c46318375635d..5434ca248a5167e5461014491d77f422980ae693 100644 (file)
@@ -82,7 +82,7 @@ describe('Search tests', function() {
         });
     });
 
-    it.only('can display path of the selected item', function() {
+    it('can display path of the selected item', function() {
         const colName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
 
         // Creates the collection using the admin token so we can set up
@@ -104,4 +104,26 @@ describe('Search tests', function() {
             cy.get('[data-cy=element-path]').should('contain', `/ Projects / ${colName}`);
         });
     });
+
+    it('can display owner of the item', function() {
+        const colName = `Collection ${Math.floor(Math.random() * Math.floor(999999))}`;
+
+        cy.createCollection(adminUser.token, {
+            name: colName,
+            owner_uuid: activeUser.user.uuid,
+            preserve_version: true,
+            manifest_text: ". 37b51d194a7513e45b56f6524f2d51f2+3 0:3:bar\n"
+        }).then(function() {
+            cy.loginAs(activeUser);
+
+            cy.doSearch(colName);
+
+            cy.get('[data-cy=search-results]').should('contain', colName);
+
+            cy.get('[data-cy=search-results]').contains(colName).closest('tr')
+                .within(() => {
+                    cy.get('p').contains(activeUser.user.uuid).should('contain', activeUser.user.full_name);
+                });
+        });
+    });
 });
\ No newline at end of file