From 0a7823d45623c1472f0ddc9b3e1dfa5619be2353 Mon Sep 17 00:00:00 2001 From: Lucas Di Pentima Date: Fri, 11 Feb 2022 19:25:15 -0300 Subject: [PATCH] 18315: Adds test exposing bug in file browser. The collection's file browser doesn't update when clicking on the Refresh button. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- cypress/integration/collection.spec.js | 29 +++++++++++++++++++ cypress/integration/side-panel.spec.js | 1 - .../collection-panel-files.tsx | 2 +- tools/arvados_config.yml | 2 ++ 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/cypress/integration/collection.spec.js b/cypress/integration/collection.spec.js index 91f58904..a6146ba2 100644 --- a/cypress/integration/collection.spec.js +++ b/cypress/integration/collection.spec.js @@ -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}`; diff --git a/cypress/integration/side-panel.spec.js b/cypress/integration/side-panel.spec.js index afe326e3..4c824d32 100644 --- a/cypress/integration/side-panel.spec.js +++ b/cypress/integration/side-panel.spec.js @@ -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'); diff --git a/src/components/collection-panel-files/collection-panel-files.tsx b/src/components/collection-panel-files/collection-panel-files.tsx index 1ef6b5c9..459d9d20 100644 --- a/src/components/collection-panel-files/collection-panel-files.tsx +++ b/src/components/collection-panel-files/collection-panel-files.tsx @@ -567,7 +567,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState } } - :
No data available
+ :
This collection is empty
}} :
} diff --git a/tools/arvados_config.yml b/tools/arvados_config.yml index 55dc8a02..b9bcfbe0 100644 --- a/tools/arvados_config.yml +++ b/tools/arvados_config.yml @@ -15,6 +15,8 @@ Clusters: ForwardSlashNameSubstitution: / ManagedProperties: original_owner_uuid: {Function: original_owner, Protected: true} + WebDAVCache: + UUIDTTL: 0s Login: PAM: Enable: true -- 2.30.2