From 6989da0b3a7314bf7e32dd79c1902ce9be9490dc Mon Sep 17 00:00:00 2001 From: Pranav Kanade Date: Sat, 5 Jun 2021 11:01:18 +0530 Subject: [PATCH] Fix/update cypress command delete user from org (#4930) * added the isOpen and onClose pros to context menu component * added a warning shown before letting a user leave org * added confirmation modal for removing members from table * Added warning modal to be showing on member deletion * updated cypress tests * fixed typo * removed log * updated deleteUserFromOrg cypress command --- app/client/cypress/locators/HomePage.json | 2 ++ app/client/cypress/support/commands.js | 2 ++ app/client/src/pages/organization/DeleteConfirmationModal.tsx | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/client/cypress/locators/HomePage.json b/app/client/cypress/locators/HomePage.json index 39bfc865de..d6b0808e4b 100644 --- a/app/client/cypress/locators/HomePage.json +++ b/app/client/cypress/locators/HomePage.json @@ -63,6 +63,8 @@ "orgImportAppOption": "[data-cy=t--org-import-app]", "orgImportAppModal": ".t--import-application-modal", "orgImportAppButton": "[data-cy=t--org-import-app-button]", + "leaveOrgConfirmModal": ".t--member-delete-confirmation-modal", + "leaveOrgConfirmButton": "[data-cy=t--org-leave-button]", "orgNameInput": "[data-cy=t--org-name-input]", "renameOrgInput": "[data-cy=t--org-rename-input]", "orgEmailInput": "[data-cy=t--org-email-input]", diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 1e49791eaa..aa74b07d33 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -170,6 +170,8 @@ Cypress.Commands.add("deleteUserFromOrg", (orgName, email) => { cy.get(homePage.DeleteBtn) .last() .click({ force: true }); + cy.get(homePage.leaveOrgConfirmModal).should("be.visible"); + cy.get(homePage.leaveOrgConfirmButton).click({ force: true }); cy.xpath(homePage.appHome) .first() .should("be.visible") diff --git a/app/client/src/pages/organization/DeleteConfirmationModal.tsx b/app/client/src/pages/organization/DeleteConfirmationModal.tsx index 333675b6d5..a8f3176b9b 100644 --- a/app/client/src/pages/organization/DeleteConfirmationModal.tsx +++ b/app/client/src/pages/organization/DeleteConfirmationModal.tsx @@ -72,7 +72,7 @@ function DeleteConfirmationModal(props: DeleteConfirmationProps) { />