mirror of
https://github.com/nextcloud/server.git
synced 2026-03-05 15:01:16 -05:00
test: adjust cypress tests for updated @nextcloud/password-confirmation
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
19ac44f6cb
commit
58fa21f6f0
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')
|
||||
|
||||
// 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')
|
||||
handlePasswordConfirmation(user1.password)
|
||||
|
||||
|
|
@ -104,7 +104,7 @@ describe('Files user credentials', { testIsolation: true }, () => {
|
|||
cy.get('@storageDialog').should('not.exist')
|
||||
|
||||
// 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')
|
||||
handlePasswordConfirmation(user2.password)
|
||||
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ describe('files_external settings', () => {
|
|||
.click()
|
||||
})
|
||||
|
||||
cy.findByRole('dialog', { name: 'Confirm your password' })
|
||||
cy.findByRole('dialog', { name: 'Authentication required' })
|
||||
.should('not.exist')
|
||||
})
|
||||
|
||||
|
|
@ -79,7 +79,7 @@ describe('files_external settings', () => {
|
|||
.click()
|
||||
})
|
||||
|
||||
cy.findByRole('dialog', { name: 'Confirm your password' })
|
||||
cy.findByRole('dialog', { name: 'Authentication required' })
|
||||
.should('not.exist')
|
||||
})
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ describe('files_external settings', () => {
|
|||
.click()
|
||||
})
|
||||
|
||||
cy.findByRole('dialog', { name: 'Confirm your password' })
|
||||
cy.findByRole('dialog', { name: 'Authentication required' })
|
||||
.should('be.visible')
|
||||
})
|
||||
})
|
||||
|
|
|
|||
|
|
@ -72,11 +72,13 @@ 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.get('input[type="password"]')
|
||||
.type(adminPassword)
|
||||
cy.findByRole('button', { name: 'Confirm' })
|
||||
.click()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue