mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-11 15:10:48 +02:00
Merge pull request #3064 from overleaf/ta-manage-multiple-groups
Allow Users to Manage Multiple Groups GitOrigin-RevId: c918da0114cdd1d679223f69d81159b4c2608874
This commit is contained in:
@@ -44,9 +44,7 @@ describe('SubscriptionGroupController', function() {
|
||||
this.GroupHandler = { removeUserFromGroup: sinon.stub().callsArgWith(2) }
|
||||
|
||||
this.SubscriptionLocator = {
|
||||
findManagedSubscription: sinon
|
||||
.stub()
|
||||
.callsArgWith(1, null, this.subscription)
|
||||
getSubscription: sinon.stub().callsArgWith(1, null, this.subscription)
|
||||
}
|
||||
|
||||
this.AuthenticationController = {
|
||||
@@ -91,4 +89,29 @@ describe('SubscriptionGroupController', function() {
|
||||
return this.Controller.removeUserFromGroup(this.req, res)
|
||||
})
|
||||
})
|
||||
|
||||
describe('removeSelfFromGroup', function() {
|
||||
it('gets subscription and remove user', function(done) {
|
||||
const userIdToRemove = '31231'
|
||||
this.req.query = { subscriptionId: this.subscriptionId }
|
||||
const memberUserIdToremove = 123456789
|
||||
this.req.session.user._id = memberUserIdToremove
|
||||
|
||||
const res = {
|
||||
sendStatus: () => {
|
||||
sinon.assert.calledWith(
|
||||
this.SubscriptionLocator.getSubscription,
|
||||
this.subscriptionId
|
||||
)
|
||||
sinon.assert.calledWith(
|
||||
this.GroupHandler.removeUserFromGroup,
|
||||
this.subscriptionId,
|
||||
memberUserIdToremove
|
||||
)
|
||||
return done()
|
||||
}
|
||||
}
|
||||
return this.Controller.removeSelfFromGroup(this.req, res)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user