mirror of
https://github.com/overleaf/overleaf.git
synced 2025-01-27 06:43:49 +00:00
Merge pull request #2813 from overleaf/ns-ta-group-account-admin
Add admin to group account when new group account is created GitOrigin-RevId: 81c49a0b414896153a85a8ba1afc364164047c1c
This commit is contained in:
parent
43a88a0939
commit
4349e85444
2 changed files with 13 additions and 1 deletions
|
@ -265,6 +265,10 @@ const SubscriptionUpdater = {
|
|||
)
|
||||
}
|
||||
if (plan.groupPlan) {
|
||||
if (!subscription.groupPlan) {
|
||||
subscription.member_ids = subscription.member_ids || []
|
||||
subscription.member_ids.push(subscription.admin_id)
|
||||
}
|
||||
subscription.groupPlan = true
|
||||
subscription.membersLimit = plan.membersLimit
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ describe('SubscriptionUpdater', function() {
|
|||
_id: '111111111111111111111111',
|
||||
admin_id: this.adminUser._id,
|
||||
manager_ids: [this.adminUser._id],
|
||||
member_ids: this.allUserIds,
|
||||
member_ids: [],
|
||||
save: sinon.stub().callsArgWith(0),
|
||||
planCode: 'student_or_something'
|
||||
}
|
||||
|
@ -241,6 +241,10 @@ describe('SubscriptionUpdater', function() {
|
|||
this.SubscriptionUpdater.deleteSubscription = sinon.stub().yields()
|
||||
})
|
||||
|
||||
afterEach(function() {
|
||||
this.subscription.member_ids = []
|
||||
})
|
||||
|
||||
it('should update the subscription with token etc when not expired', function(done) {
|
||||
this.SubscriptionUpdater._updateSubscriptionFromRecurly(
|
||||
this.recurlySubscription,
|
||||
|
@ -284,6 +288,7 @@ describe('SubscriptionUpdater', function() {
|
|||
})
|
||||
|
||||
it('should update all the users features', function(done) {
|
||||
this.subscription.member_ids = this.allUserIds
|
||||
this.SubscriptionUpdater._updateSubscriptionFromRecurly(
|
||||
this.recurlySubscription,
|
||||
this.subscription,
|
||||
|
@ -323,6 +328,9 @@ describe('SubscriptionUpdater', function() {
|
|||
}
|
||||
this.subscription.membersLimit.should.equal(5)
|
||||
this.subscription.groupPlan.should.equal(true)
|
||||
this.subscription.member_ids.should.deep.equal([
|
||||
this.subscription.admin_id
|
||||
])
|
||||
done()
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue