21359: added test Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox@curii.com>
[arvados.git] / services / workbench2 / cypress / integration / project.spec.js
index 47eed5ffe86dd201a45b3d56380abc0e335c4983..c03aa8dcd5f898cdbfd8c5380bbbb607a4d5049c 100644 (file)
@@ -180,6 +180,45 @@ describe("Project tests", function () {
         verifyProjectDescription(projName, null);
     });
 
+    it("creates a project from the context menu in the correct subfolder", function () {
+        const parentProjName = `Test project (${Math.floor(999999 * Math.random())})`;
+        const childProjName = `Test project (${Math.floor(999999 * Math.random())})`;
+        cy.loginAs(activeUser);
+
+        // Create project
+        cy.get("[data-cy=side-panel-button]").click();
+        cy.get("[data-cy=side-panel-new-project]").click();
+        cy.get("[data-cy=form-dialog]")
+            .should("contain", "New Project")
+            .within(() => {
+                cy.get("[data-cy=name-field]").within(() => {
+                    cy.get("input").type(parentProjName);
+                });
+            });
+        cy.get("[data-cy=form-submit-btn]").click();
+        cy.get("[data-cy=form-dialog]").should("not.exist");
+        cy.go('back')
+
+        // Create subproject from context menu
+        cy.get("[data-cy=project-panel] tbody tr").contains(parentProjName).rightclick({ force: true });
+        cy.get("[data-cy=context-menu]").contains("New project").click();
+        cy.get("[data-cy=form-dialog]")
+            .should("contain", "New Project")
+            .within(() => {
+                cy.get("[data-cy=name-field]").within(() => {
+                    cy.get("input").type(childProjName);
+                });
+            });
+        cy.get("[data-cy=form-submit-btn]").click();
+        cy.get("[data-cy=form-dialog]").should("not.exist");
+
+        // open details panel and check 'owner' field
+        cy.get("[data-cy=additional-info-icon]").click();
+        cy.waitForDom();
+        cy.get("[data-cy=details-panel-owner]").contains(parentProjName).should("be.visible")
+        cy.get("[data-cy=additional-info-icon]").click();
+    });
+
     it('shows the appropriate buttons in the multiselect toolbar', () => {
 
         const msButtonTooltips = [