mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 13:03:42 -05:00
585d72f1a6
[server-pro] add test for rendering of user activate page GitOrigin-RevId: 3f0b8f7fa39698b739c9c5259da29fdd88b9caf6
34 lines
1,008 B
TypeScript
34 lines
1,008 B
TypeScript
import { createMongoUser, ensureUserExists, login } from './helpers/login'
|
|
import { startWith } from './helpers/config'
|
|
|
|
describe('Accounts', function () {
|
|
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' })
|
|
})
|
|
})
|
|
})
|