test: adjust cypress tests for updated `@nextcloud/password-confirmation`

Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
pull/56324/head
Andy Scherzinger 2025-11-13 13:20:59 +07:00
parent 2de1030df9
commit 90156c8037
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
2 changed files with 5 additions and 4 deletions

@ -66,7 +66,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
storageDialog.should('not.exist')
// Storage dialog now closed, the user auth dialog should be visible
const authDialog = cy.findByRole('dialog', { name: 'Confirm your password' })
const authDialog = cy.findByRole('dialog', { name: 'Authentication required' })
authDialog.should('be.visible')
handlePasswordConfirmation(user1.password)
@ -115,7 +115,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
.should('not.exist')
// Storage dialog now closed, the user auth dialog should be visible
cy.findByRole('dialog', { name: 'Confirm your password' })
cy.findByRole('dialog', { name: 'Authentication required' })
.as('authDialog')
.should('be.visible')
handlePasswordConfirmation(user2.password)

@ -72,11 +72,12 @@ export function toggleEditButton(user: User, toEdit = true) {
*/
export function handlePasswordConfirmation(adminPassword = 'admin') {
const handleModal = (context: Cypress.Chainable) => {
return context.contains('.modal-container', 'Confirm your password')
return context.contains('.modal-container', 'Authentication required')
.if()
.within(() => {
cy.get('input[type="password"]').type(adminPassword)
cy.get('button').contains('Confirm').click()
cy.findByRole('button', { name: 'Confirm' })
.click()
})
}