|
@@ -48,6 +48,10 @@ describe('UserPagesController', function () {
|
|
|
zotero: { encrypted: 'bbbb' },
|
|
zotero: { encrypted: 'bbbb' },
|
|
|
},
|
|
},
|
|
|
}
|
|
}
|
|
|
|
|
+ this.adminEmail = 'group-admin-email@overleaf.com'
|
|
|
|
|
+ this.subscriptionViewModel = {
|
|
|
|
|
+ memberGroupSubscriptions: [],
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
this.UserGetter = {
|
|
this.UserGetter = {
|
|
|
getUser: sinon.stub(),
|
|
getUser: sinon.stub(),
|
|
@@ -73,6 +77,11 @@ describe('UserPagesController', function () {
|
|
|
this.PersonalAccessTokenManager = {
|
|
this.PersonalAccessTokenManager = {
|
|
|
listTokens: sinon.stub().returns([]),
|
|
listTokens: sinon.stub().returns([]),
|
|
|
}
|
|
}
|
|
|
|
|
+ this.SubscriptionLocator = {
|
|
|
|
|
+ promises: {
|
|
|
|
|
+ getAdminEmail: sinon.stub().returns(this.adminEmail),
|
|
|
|
|
+ },
|
|
|
|
|
+ }
|
|
|
this.UserPagesController = SandboxedModule.require(modulePath, {
|
|
this.UserPagesController = SandboxedModule.require(modulePath, {
|
|
|
requires: {
|
|
requires: {
|
|
|
'@overleaf/settings': this.settings,
|
|
'@overleaf/settings': this.settings,
|
|
@@ -82,6 +91,7 @@ describe('UserPagesController', function () {
|
|
|
'../Errors/ErrorController': this.ErrorController,
|
|
'../Errors/ErrorController': this.ErrorController,
|
|
|
'../Authentication/AuthenticationController':
|
|
'../Authentication/AuthenticationController':
|
|
|
this.AuthenticationController,
|
|
this.AuthenticationController,
|
|
|
|
|
+ '../Subscription/SubscriptionLocator': this.SubscriptionLocator,
|
|
|
'../../infrastructure/Features': this.Features,
|
|
'../../infrastructure/Features': this.Features,
|
|
|
'../../../../modules/oauth2-server/app/src/OAuthPersonalAccessTokenManager':
|
|
'../../../../modules/oauth2-server/app/src/OAuthPersonalAccessTokenManager':
|
|
|
this.PersonalAccessTokenManager,
|
|
this.PersonalAccessTokenManager,
|
|
@@ -325,6 +335,14 @@ describe('UserPagesController', function () {
|
|
|
return this.UserPagesController.settingsPage(this.req, this.res)
|
|
return this.UserPagesController.settingsPage(this.req, this.res)
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+ it('should send the correct managed user admin email', function (done) {
|
|
|
|
|
+ this.res.render = (page, opts) => {
|
|
|
|
|
+ expect(opts.currentManagedUserAdminEmail).to.equal(this.adminEmail)
|
|
|
|
|
+ return done()
|
|
|
|
|
+ }
|
|
|
|
|
+ return this.UserPagesController.settingsPage(this.req, this.res)
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
describe('when ldap.updateUserDetailsOnLogin is true', function () {
|
|
describe('when ldap.updateUserDetailsOnLogin is true', function () {
|
|
|
beforeEach(function () {
|
|
beforeEach(function () {
|
|
|
return (this.settings.ldap = { updateUserDetailsOnLogin: true })
|
|
return (this.settings.ldap = { updateUserDetailsOnLogin: true })
|