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

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
pull/56294/head
Ferdinand Thiessen 2025-10-15 17:30:15 +07:00 committed by Andy Scherzinger
parent 19ac44f6cb
commit 58fa21f6f0
No known key found for this signature in database
GPG Key ID: 6CADC7E3523C308B
3 changed files with 10 additions and 8 deletions

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

@ -62,7 +62,7 @@ describe('files_external settings', () => {
.click() .click()
}) })
cy.findByRole('dialog', { name: 'Confirm your password' }) cy.findByRole('dialog', { name: 'Authentication required' })
.should('not.exist') .should('not.exist')
}) })
@ -79,7 +79,7 @@ describe('files_external settings', () => {
.click() .click()
}) })
cy.findByRole('dialog', { name: 'Confirm your password' }) cy.findByRole('dialog', { name: 'Authentication required' })
.should('not.exist') .should('not.exist')
}) })
@ -98,7 +98,7 @@ describe('files_external settings', () => {
.click() .click()
}) })
cy.findByRole('dialog', { name: 'Confirm your password' }) cy.findByRole('dialog', { name: 'Authentication required' })
.should('be.visible') .should('be.visible')
}) })
}) })

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