18315: Adds test exposing bug in file browser.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 11 Feb 2022 22:25:15 +0000 (19:25 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Tue, 15 Feb 2022 18:54:47 +0000 (15:54 -0300)
The collection's file browser doesn't update when clicking on the Refresh
button.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

cypress/integration/collection.spec.js
cypress/integration/side-panel.spec.js
src/components/collection-panel-files/collection-panel-files.tsx
tools/arvados_config.yml

index 91f5890417f657bd3bd3362bc772c2d19cdc09a6..a6146ba2f8823c65270aa57b09dd0b3e42a285b6 100644 (file)
@@ -626,6 +626,35 @@ describe('Collection panel tests', function () {
             });
     });
 
+    it('updates the collection UI contents by using the Refresh button', function () {
+        const collName = `Test Collection ${Math.floor(Math.random() * 999999)}`;
+        const fileName = 'foobar'
+
+        cy.createCollection(adminUser.token, {
+            name: collName,
+            owner_uuid: activeUser.user.uuid,
+        }).as('testCollection');
+
+        cy.getAll('@testCollection').then(function ([testCollection]) {
+            cy.loginAs(activeUser);
+            cy.goToPath(`/collections/${testCollection.uuid}`);
+            cy.get('[data-cy=collection-files-panel]').should('contain', 'This collection is empty');
+            cy.get('[data-cy=collection-files-panel]').should('not.contain', fileName);
+            cy.get('[data-cy=collection-info-panel]').should('contain', collName);
+
+            cy.updateCollection(adminUser.token, testCollection.uuid, {
+                name: `${collName + ' updated'}`,
+                manifest_text: `. 37b51d194a7513e45b56f6524f2d51f2+3 0:3:${fileName}\n`,
+            }).as('updatedCollection');
+            cy.getAll('@updatedCollection').then(function ([updatedCollection]) {
+                cy.contains('Refresh').click();
+                expect(updatedCollection.name).to.equal(`${collName + ' updated'}`);
+                cy.get('[data-cy=collection-info-panel]').should('contain', updatedCollection.name);
+                cy.get('[data-cy=collection-files-panel]').should('contain', fileName);
+            });
+        });
+    })
+
     it('makes a copy of an existing collection', function() {
         const collName = `Test Collection ${Math.floor(Math.random() * 999999)}`;
         const copyName = `Copy of: ${collName}`;
index afe326e39a15166075bbf399a5578c16422b8b6b..4c824d3275f5d83bf53a04da7dc1abf41312a9d1 100644 (file)
@@ -82,7 +82,6 @@ describe('Side panel tests', function() {
             group_class: 'filter',
             properties: {filters: []},
         }).as('myFavoriteFilterGroup').then(function (myFavoriteFilterGroup) {
-            cy.contains('Refresh').click();
             cy.goToPath(`/projects/${myFavoriteFilterGroup.uuid}`);
             cy.get('[data-cy=breadcrumb-last]').should('contain', 'my-favorite-filter-group');
 
index 1ef6b5c94cdf117ea52a932c47a085957ce6c2d2..459d9d2082349f79c78ef592861395e34baf337a 100644 (file)
@@ -567,7 +567,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
                                                     </div>
                                                 }
                                             }
-                                        </FixedSizeList> : <div className={classes.rowEmpty}>No data available</div>
+                                        </FixedSizeList> : <div className={classes.rowEmpty}>This collection is empty</div>
                                     }}
                                 </AutoSizer> : <div className={classes.row}><CircularProgress className={classes.loader} size={30} /></div>
                         }
index 55dc8a020b2361769d85a1155af946cbd5c34bc5..b9bcfbe0d3327880f39244d321718f374b4f1aac 100644 (file)
@@ -15,6 +15,8 @@ Clusters:
       ForwardSlashNameSubstitution: /
       ManagedProperties:
         original_owner_uuid: {Function: original_owner, Protected: true}
+      WebDAVCache:
+        UUIDTTL: 0s
     Login:
       PAM:
         Enable: true