mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Merge pull request #18745 from overleaf/jpa-active-uses-correct-email
[server-pro] add test for rendering of user activate page GitOrigin-RevId: 3f0b8f7fa39698b739c9c5259da29fdd88b9caf6
This commit is contained in:
parent
32b74f1471
commit
585d72f1a6
2 changed files with 22 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
import { ensureUserExists, login } from './helpers/login'
|
||||
import { createMongoUser, ensureUserExists, login } from './helpers/login'
|
||||
import { startWith } from './helpers/config'
|
||||
|
||||
describe('Accounts', function () {
|
||||
|
@ -11,4 +11,24 @@ describe('Accounts', function () {
|
|||
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' })
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
@ -8,7 +8,7 @@ export function resetCreatedUsersCache() {
|
|||
createdUsers.clear()
|
||||
}
|
||||
|
||||
async function createMongoUser({
|
||||
export async function createMongoUser({
|
||||
email,
|
||||
isAdmin = false,
|
||||
}: {
|
||||
|
|
Loading…
Reference in a new issue