aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cypress/e2e/settings/users.cy.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/cypress/e2e/settings/users.cy.ts b/cypress/e2e/settings/users.cy.ts
index 3a96f7546db..9bc0c8ad657 100644
--- a/cypress/e2e/settings/users.cy.ts
+++ b/cypress/e2e/settings/users.cy.ts
@@ -150,6 +150,20 @@ describe('Settings: Create and delete users', function() {
cy.get('.action-item__popper .action').contains('Delete user').should('exist').click()
// And confirmation dialog accepted
cy.get('.oc-dialog button').contains(`Delete ${jdoe.userId}`).click()
+
+ // Ignore failure if modal is not shown
+ cy.once('fail', (error) => {
+ expect(error.name).to.equal('AssertionError')
+ expect(error).to.have.property('node', '.modal-container')
+ })
+ // Make sure no confirmation modal is shown
+ cy.get('body').find('.modal-container').then(($modal) => {
+ if ($modal.length > 0) {
+ cy.wrap($modal).find('input[type="password"]').type(admin.password)
+ cy.wrap($modal).find('button').contains('Confirm').click()
+ }
+ })
+
// deleted clicked the user is not shown anymore
cy.get(`tbody.user-list__body tr td[data-test="${jdoe.userId}"]`).parents('tr').should('not.be.visible')
})