Skip to content

Commit 58fa21f

Browse files
susnuxAndyScherzinger
authored andcommitted
test: adjust cypress tests for updated @nextcloud/password-confirmation
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 19ac44f commit 58fa21f

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

cypress/e2e/files_external/files-user-credentials.cy.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
6262
cy.get('@storageDialog').should('not.exist')
6363

6464
// Storage dialog now closed, the user auth dialog should be visible
65-
cy.findByRole('dialog', { name: 'Confirm your password' }).as('authDialog')
65+
cy.findByRole('dialog', { name: 'Authentication required' }).as('authDialog')
6666
cy.get('@authDialog').should('be.visible')
6767
handlePasswordConfirmation(user1.password)
6868

@@ -104,7 +104,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
104104
cy.get('@storageDialog').should('not.exist')
105105

106106
// Storage dialog now closed, the user auth dialog should be visible
107-
cy.findByRole('dialog', { name: 'Confirm your password' }).as('authDialog')
107+
cy.findByRole('dialog', { name: 'Authentication required' }).as('authDialog')
108108
cy.get('@authDialog').should('be.visible')
109109
handlePasswordConfirmation(user2.password)
110110

cypress/e2e/files_external/settings.cy.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('files_external settings', () => {
6262
.click()
6363
})
6464

65-
cy.findByRole('dialog', { name: 'Confirm your password' })
65+
cy.findByRole('dialog', { name: 'Authentication required' })
6666
.should('not.exist')
6767
})
6868

@@ -79,7 +79,7 @@ describe('files_external settings', () => {
7979
.click()
8080
})
8181

82-
cy.findByRole('dialog', { name: 'Confirm your password' })
82+
cy.findByRole('dialog', { name: 'Authentication required' })
8383
.should('not.exist')
8484
})
8585

@@ -98,7 +98,7 @@ describe('files_external settings', () => {
9898
.click()
9999
})
100100

101-
cy.findByRole('dialog', { name: 'Confirm your password' })
101+
cy.findByRole('dialog', { name: 'Authentication required' })
102102
.should('be.visible')
103103
})
104104
})

cypress/e2e/settings/usersUtils.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ export function toggleEditButton(user: User, toEdit = true) {
7272
*/
7373
export function handlePasswordConfirmation(adminPassword = 'admin') {
7474
const handleModal = (context: Cypress.Chainable) => {
75-
return context.contains('.modal-container', 'Confirm your password')
75+
return context.contains('.modal-container', 'Authentication required')
7676
.if()
7777
.within(() => {
78-
cy.get('input[type="password"]').type(adminPassword)
79-
cy.get('button').contains('Confirm').click()
78+
cy.get('input[type="password"]')
79+
.type(adminPassword)
80+
cy.findByRole('button', { name: 'Confirm' })
81+
.click()
8082
})
8183
}
8284

0 commit comments

Comments
 (0)