mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Refresh members and invites in client when status changes
This commit is contained in:
@@ -128,6 +128,9 @@ describe "CollaboratorsController", ->
|
||||
it "should send the back a success response", ->
|
||||
@res.sendStatus.calledWith(204).should.equal true
|
||||
|
||||
it 'should have called emitToRoom', ->
|
||||
@EditorRealTimeController.emitToRoom.calledWith(@project_id, 'project:membership:changed').should.equal true
|
||||
|
||||
describe "removeSelfFromProject", ->
|
||||
beforeEach ->
|
||||
@req.session =
|
||||
|
||||
+13
@@ -22,6 +22,7 @@ describe "CollaboratorsInviteController", ->
|
||||
"./CollaboratorsHandler": @CollaboratorsHandler = {}
|
||||
"./CollaboratorsInviteHandler": @CollaboratorsInviteHandler = {}
|
||||
'logger-sharelatex': @logger = {err: sinon.stub(), error: sinon.stub(), log: sinon.stub()}
|
||||
"../Editor/EditorRealTimeController": @EditorRealTimeController = {emitToRoom: sinon.stub()}
|
||||
@res = new MockResponse()
|
||||
@req = new MockRequest()
|
||||
|
||||
@@ -112,6 +113,10 @@ describe "CollaboratorsInviteController", ->
|
||||
@CollaboratorsInviteHandler.inviteToProject.callCount.should.equal 1
|
||||
@CollaboratorsInviteHandler.inviteToProject.calledWith(@project_id,@current_user_id,@targetEmail,@privileges).should.equal true
|
||||
|
||||
it 'should have called emitToRoom', ->
|
||||
@EditorRealTimeController.emitToRoom.callCount.should.equal 1
|
||||
@EditorRealTimeController.emitToRoom.calledWith(@project_id, 'project:membership:changed').should.equal true
|
||||
|
||||
describe 'when the user is not allowed to add more collaborators', ->
|
||||
|
||||
beforeEach ->
|
||||
@@ -499,6 +504,10 @@ describe "CollaboratorsInviteController", ->
|
||||
it 'should have called revokeInvite', ->
|
||||
@CollaboratorsInviteHandler.revokeInvite.callCount.should.equal 1
|
||||
|
||||
it 'should have called emitToRoom', ->
|
||||
@EditorRealTimeController.emitToRoom.callCount.should.equal 1
|
||||
@EditorRealTimeController.emitToRoom.calledWith(@project_id, 'project:membership:changed').should.equal true
|
||||
|
||||
describe 'when revokeInvite produces an error', ->
|
||||
|
||||
beforeEach ->
|
||||
@@ -544,6 +553,10 @@ describe "CollaboratorsInviteController", ->
|
||||
it 'should have called acceptInvite', ->
|
||||
@CollaboratorsInviteHandler.acceptInvite.callCount.should.equal 1
|
||||
|
||||
it 'should have called emitToRoom', ->
|
||||
@EditorRealTimeController.emitToRoom.callCount.should.equal 1
|
||||
@EditorRealTimeController.emitToRoom.calledWith(@project_id, 'project:membership:changed').should.equal true
|
||||
|
||||
describe 'when revokeInvite produces an error', ->
|
||||
|
||||
beforeEach ->
|
||||
|
||||
Reference in New Issue
Block a user