17579: Added search input clear after project change
[arvados-workbench2.git] / cypress / integration / project.spec.js
index 1c1759523ea0243113d0dd41fcbecbcfe636b257..4d77d3a5d1b9d67f61090fdf442f40a3f5c2a1e5 100644 (file)
@@ -194,4 +194,27 @@ describe('Project tests', function() {
             cy.contains(testRootProject.uuid).should('exist');
         });
     });
+
+    it('clears search input when changing project', () => {
+        cy.createGroup(activeUser.token, {
+            name: `Test root project ${Math.floor(Math.random() * 999999)}`,
+            group_class: 'project',
+        }).as('testProject1');
+        cy.createGroup(activeUser.token, {
+            name: `Test root project ${Math.floor(Math.random() * 999999)}`,
+            group_class: 'project',
+        }).as('testProject2');
+
+        cy.getAll('@testProject1', '@testProject2').then(function([testProject1, testProject2]) {
+            cy.loginAs(activeUser);
+
+            cy.get('[data-cy=side-panel-tree]').contains(testProject1.name).click();
+
+            cy.get('[data-cy=search-input] input').type('test123');
+
+            cy.get('[data-cy=side-panel-tree]').contains('Projects').click();
+
+            cy.get('[data-cy=search-input] input').should('not.have.value', 'test123');
+        });
+    });
 });
\ No newline at end of file