18219: Updates cypress tests.
[arvados-workbench2.git] / cypress / integration / project.spec.js
index 1c1759523ea0243113d0dd41fcbecbcfe636b257..3ffdcc2df2cbc796db9ea4a4314a32cbd2809560 100644 (file)
@@ -28,7 +28,7 @@ describe('Project tests', function() {
         cy.clearLocalStorage();
     });
 
-    it('adds creates a new project with properties', function() {
+    it('creates a new project with properties', function() {
         const projName = `Test project (${Math.floor(999999 * Math.random())})`;
         cy.loginAs(activeUser);
         cy.get('[data-cy=side-panel-button]').click();
@@ -194,4 +194,23 @@ 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.getAll('@testProject1').then(function([testProject1]) {
+            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