overleaf/server-ce/test/accounts.spec.ts
Jakob Ackermann eb32d3c8be Merge pull request #19270 from overleaf/jpa-faster-e2e-in-ci
[server-pro] faster e2e test CI wall time

GitOrigin-RevId: eeb6d3044d888acd4d52919507c0bc566d7e0b46
2024-07-15 09:03:49 +00:00

35 lines
1.1 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.findByText('Account').click()
cy.findByText('Log Out').click()
})
it('should render the email on the user activate screen', () => {
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.findByText('Please set a password')
cy.get('input[autocomplete="username"]').should(
'have.attr',
'value',
email
)
cy.get('input[name="password"]')
cy.findByRole('button', { name: 'Activate' })
})
})
})