X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/efb6e397a2d9ec98c8a9fa1f47bea66d8651bb81..0a7823d45623c1472f0ddc9b3e1dfa5619be2353:/cypress/integration/collection.spec.js 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}`;