mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
* Update selectors to improve test stability * Update selectors to improve test stability * Use plain string matchers * Fix test * [monorepo] use plain string matchers everywhere * [web] remove Kb/ prefix from title of learn wiki links --------- Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com> GitOrigin-RevId: 12e13c39822795338a3bee20236454f9948e6221
39 lines
1.2 KiB
TypeScript
39 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', () => {
|
|
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' })
|
|
})
|
|
})
|
|
})
|