mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #29614 from overleaf/ii-domain-capture-mu-email-check
[web] Check email from SAML callback before enrollment page GitOrigin-RevId: 3c8224d42b87969290d5031a28d4ec217e875d84
This commit is contained in:
+50
-15
@@ -83,24 +83,59 @@ describe('<DomainCapture />', function () {
|
||||
})
|
||||
})
|
||||
|
||||
it('renders institution error message', function () {
|
||||
const errorMsg = 'Error message'
|
||||
const notificationsInstitution = [
|
||||
{
|
||||
templateKey: 'notification_institution_sso_error',
|
||||
error: {
|
||||
message: errorMsg,
|
||||
describe('notifications', function () {
|
||||
it('renders missing email on account error message', function () {
|
||||
const institutionEmail = 'email@example.com'
|
||||
const notificationsInstitution = [
|
||||
{
|
||||
templateKey: 'notification_email_not_in_account',
|
||||
institutionEmail,
|
||||
},
|
||||
},
|
||||
]
|
||||
cy.window().then(win => {
|
||||
win.metaAttributesCache.set(
|
||||
'ol-notificationsInstitution',
|
||||
notificationsInstitution
|
||||
]
|
||||
cy.window().then(win => {
|
||||
win.metaAttributesCache.set(
|
||||
'ol-notificationsInstitution',
|
||||
notificationsInstitution
|
||||
)
|
||||
})
|
||||
cy.mount(<DomainCapture />)
|
||||
|
||||
cy.findByRole('alert').should(
|
||||
'contain.text',
|
||||
`Your identity provider returned ${institutionEmail}, which ` +
|
||||
`is not already on your current Overleaf account. You will need to ` +
|
||||
`log out and create a new Overleaf account with ${institutionEmail} ` +
|
||||
`via the SSO log in page. Once this is done, you can ` +
|
||||
`transfer your existing projects to the new account.`
|
||||
)
|
||||
cy.findByRole('link', {
|
||||
name: /transfer your existing projects/i,
|
||||
}).should(
|
||||
'have.attr',
|
||||
'href',
|
||||
'/learn/how-to/How_to_Transfer_Project_Ownership'
|
||||
)
|
||||
})
|
||||
cy.mount(<DomainCapture />)
|
||||
|
||||
cy.findByRole('alert').should('contain.text', errorMsg)
|
||||
it('renders institution error message', function () {
|
||||
const errorMsg = 'Error message'
|
||||
const notificationsInstitution = [
|
||||
{
|
||||
templateKey: 'notification_institution_sso_error',
|
||||
error: {
|
||||
message: errorMsg,
|
||||
},
|
||||
},
|
||||
]
|
||||
cy.window().then(win => {
|
||||
win.metaAttributesCache.set(
|
||||
'ol-notificationsInstitution',
|
||||
notificationsInstitution
|
||||
)
|
||||
})
|
||||
cy.mount(<DomainCapture />)
|
||||
|
||||
cy.findByRole('alert').should('contain.text', errorMsg)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user