X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/f85cd7bb8f67072db7f2c45cae00c98984dc3f7f..0e3d1681d9ed60bae0b91b368efb1325f5aee239:/cypress/integration/side-panel.spec.js diff --git a/cypress/integration/side-panel.spec.js b/cypress/integration/side-panel.spec.js index 8100a0e4..4c824d32 100644 --- a/cypress/integration/side-panel.spec.js +++ b/cypress/integration/side-panel.spec.js @@ -30,7 +30,6 @@ describe('Side panel tests', function() { it('enables the +NEW side panel button on users home project', function() { cy.loginAs(activeUser); - cy.doSearch(`${activeUser.user.uuid}`); cy.get('[data-cy=side-panel-button]') .should('exist') .and('not.be.disabled'); @@ -49,7 +48,7 @@ describe('Side panel tests', function() { head_uuid: this.sharedGroup.uuid, tail_uuid: activeUser.user.uuid }) - cy.doSearch(`${this.sharedGroup.uuid}`); + cy.goToPath(`/projects/${this.sharedGroup.uuid}`); cy.get('[data-cy=side-panel-button]') .should('exist') .and(`${isWritable ? 'not.' : ''}be.disabled`); @@ -67,7 +66,7 @@ describe('Side panel tests', function() { {url: '/all_processes', label: 'All Processes'}, {url: '/trash', label: 'Trash'}, ].map(function(section) { - cy.visit(section.url); + cy.goToPath(section.url); cy.get('[data-cy=breadcrumb-first]') .should('contain', section.label); cy.get('[data-cy=side-panel-button]') @@ -83,8 +82,7 @@ describe('Side panel tests', function() { group_class: 'filter', properties: {filters: []}, }).as('myFavoriteFilterGroup').then(function (myFavoriteFilterGroup) { - cy.contains('Refresh').click(); - cy.doSearch(`${myFavoriteFilterGroup.uuid}`); + cy.goToPath(`/projects/${myFavoriteFilterGroup.uuid}`); cy.get('[data-cy=breadcrumb-last]').should('contain', 'my-favorite-filter-group'); cy.get('[data-cy=side-panel-button]') @@ -93,4 +91,49 @@ describe('Side panel tests', function() { }) }) + it('can edit project in side panel', () => { + cy.createProject({ + owningUser: activeUser, + targetUser: activeUser, + projectName: 'mySharedWritableProject', + canWrite: true, + addToFavorites: false + }); + + cy.getAll('@mySharedWritableProject') + .then(function ([mySharedWritableProject]) { + cy.loginAs(activeUser); + + cy.get('[data-cy=side-panel-tree]').contains('Projects').click(); + + const newProjectName = `New project name ${mySharedWritableProject.name}`; + const newProjectDescription = `New project description ${mySharedWritableProject.name}`; + + cy.testEditProjectOrCollection('[data-cy=side-panel-tree]', mySharedWritableProject.name, newProjectName, newProjectDescription); + }); + }); + + it('side panel react to refresh when project data changes', () => { + const project = 'writableProject'; + + cy.createProject({ + owningUser: activeUser, + targetUser: activeUser, + projectName: project, + canWrite: true, + addToFavorites: false + }); + + cy.getAll('@writableProject').then(function ([writableProject]) { + cy.loginAs(activeUser); + cy.get('[data-cy=side-panel-tree]') + .contains('Projects').click(); + cy.get('[data-cy=side-panel-tree]') + .contains(writableProject.name).should('exist'); + cy.trashGroup(activeUser.token, writableProject.uuid).then(() => { + cy.contains('Refresh').click(); + cy.contains(writableProject.name).should('not.exist'); + }); + }); + }); })