19302: wrote collapse spec Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii...
[arvados-workbench2.git] / cypress / integration / side-panel.spec.js
index 912e68ebfe229c394fdb7287226060f39956202f..2bab55e861ce641c40b73b1bf39a0ee98e3312dc 100644 (file)
@@ -62,11 +62,10 @@ describe('Side panel tests', function() {
             {url: '/shared-with-me', label: 'Shared with me'},
             {url: '/public-favorites', label: 'Public Favorites'},
             {url: '/favorites', label: 'My Favorites'},
-            {url: '/workflows', label: 'Workflows'},
             {url: '/all_processes', label: 'All Processes'},
             {url: '/trash', label: 'Trash'},
         ].map(function(section) {
-            cy.goToPath(section.url);
+            cy.waitForDom().goToPath(section.url);
             cy.get('[data-cy=breadcrumb-first]')
                 .should('contain', section.label);
             cy.get('[data-cy=side-panel-button]')
@@ -82,7 +81,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');
 
@@ -104,7 +102,7 @@ describe('Side panel tests', function() {
         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}`;
@@ -114,4 +112,39 @@ describe('Side panel tests', function() {
             });
     });
 
+    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');
+            });
+        });
+    });
+
+    it.only('collapses and un-collapses', () => {
+
+            cy.loginAs(activeUser)
+            
+            cy.get('[data-cy=side-panel-tree]').should('exist')
+            cy.get('[data-cy=side-panel-toggle]').click()
+            cy.get('[data-cy=side-panel-tree]').should('not.exist')
+            cy.get('[data-cy=side-panel-toggle]').click()
+            cy.get('[data-cy=side-panel-tree]').should('exist')
+        })
+    // })
 })