Files
overleaf-cep/server-ce/test/accounts.spec.ts
Rebeka Dekany b4bfff1b67 Improve Server Pro tests to use semantic selectors (#29790)
* Replace placeholders with labels

* Add 'Close dialog' label to modal close button to distinguish from footer Close button

* Add and translate heading on the not found page

* Update textarea to have id matching label's for attribute
Simplify test for template description textarea

* Label PDF zoom level dropdown button

* Improve test selectors to use semantic roles and accessible names

GitOrigin-RevId: d215ddca30ddf844cfffbcf0e528a601b134d772
2025-11-25 09:05:48 +00:00

35 lines
1.2 KiB
TypeScript

import { createMongoUser, ensureUserExists, login } from './helpers/login'
import { isExcludedBySharding, startWith } from './helpers/config'
describe('Accounts', function () {
if (isExcludedBySharding('CE_DEFAULT')) return
startWith({})
ensureUserExists({ email: 'user@example.com' })
it('can log in and out', function () {
login('user@example.com')
cy.visit('/project')
cy.findByRole('menuitem', { name: 'Account' }).click()
cy.findByRole('menuitem', { name: 'Log Out' }).click()
cy.url().should('include', '/login')
cy.visit('/project')
cy.url().should('include', '/login')
})
it('should render the email on the user activate screen', function () {
const email = 'not-activated-user@example.com'
cy.then(async () => {
const { url } = await createMongoUser({ email })
return url
}).as('url')
cy.get('@url').then(url => {
cy.visit(`${url}`)
cy.url().should('contain', '/user/activate')
cy.findByRole('heading', { name: 'Please set a password' })
cy.findByLabelText('Email').should('be.visible')
cy.findByLabelText('Password').should('be.visible')
cy.findByRole('button', { name: 'Activate' })
})
})
})