Merge pull request #2337 from overleaf/jel-saml-already-linked

Institution linking and unlinking

GitOrigin-RevId: 1c3665fc66513c3e88a62ed477800c17759459ff
This commit is contained in:
Eric Mc Sween
2019-11-12 08:59:04 -05:00
committed by sharelatex
parent 3bd15b1a47
commit b5d7887dfb
5 changed files with 59 additions and 5 deletions
@@ -771,6 +771,35 @@ describe('ProjectController', function() {
}
this.ProjectController.projectListPage(this.req, this.res)
})
it('should show institution account linked to another account', function() {
this.res.render = (pageName, opts) => {
expect(opts.notificationsInstitution).to.deep.include({
templateKey: 'notification_institution_sso_linked_by_another'
})
// Also check other notifications are not shown
expect(opts.notificationsInstitution).to.not.deep.include({
email: this.institutionEmail,
templateKey: 'notification_institution_sso_already_registered'
})
expect(opts.notificationsInstitution).to.not.deep.include({
institutionEmail: this.institutionEmail,
requestedEmail: 'requested@overleaf.com',
templateKey: 'notification_institution_sso_non_canonical'
})
expect(opts.notificationsInstitution).to.not.deep.include({
email: this.institutionEmail,
institutionName: this.institutionName,
templateKey: 'notification_institution_sso_linked'
})
}
this.req.session.saml = {
emailNonCanonical: this.institutionEmail,
institutionEmail: this.institutionEmail,
requestedEmail: 'requested@overleaf.com',
linkedToAnother: true
}
this.ProjectController.projectListPage(this.req, this.res)
})
})
describe('When Institution SSO is not released', function() {