Merge pull request #13485 from overleaf/msm-share-modal-fetch-tokens
[web] Fetch share tokens instead of sending via websocket GitOrigin-RevId: f97bb91ca3ceb410fe860bf1c7802d8157d9f8b4
This commit is contained in:
@@ -873,7 +873,7 @@ describe('EditorController', function () {
|
||||
this.newAccessLevel = 'private'
|
||||
this.ProjectDetailsHandler.ensureTokensArePresent = sinon
|
||||
.stub()
|
||||
.yields(null, this.tokens)
|
||||
.yields()
|
||||
return this.EditorController.setPublicAccessLevel(
|
||||
this.project_id,
|
||||
this.newAccessLevel,
|
||||
@@ -898,14 +898,6 @@ describe('EditorController', function () {
|
||||
.calledWith(this.project_id)
|
||||
.should.equal(false)
|
||||
})
|
||||
|
||||
it('should not broadcast a token change', function () {
|
||||
return this.EditorRealTimeController.emitToRoom
|
||||
.calledWith(this.project_id, 'project:tokens:changed', {
|
||||
tokens: this.tokens,
|
||||
})
|
||||
.should.equal(false)
|
||||
})
|
||||
})
|
||||
|
||||
describe('when setting to tokenBased', function () {
|
||||
@@ -914,7 +906,7 @@ describe('EditorController', function () {
|
||||
this.tokens = { readOnly: 'aaa', readAndWrite: '42bbb' }
|
||||
this.ProjectDetailsHandler.ensureTokensArePresent = sinon
|
||||
.stub()
|
||||
.yields(null, this.tokens)
|
||||
.yields()
|
||||
return this.EditorController.setPublicAccessLevel(
|
||||
this.project_id,
|
||||
this.newAccessLevel,
|
||||
@@ -939,14 +931,6 @@ describe('EditorController', function () {
|
||||
.calledWith(this.project_id)
|
||||
.should.equal(true)
|
||||
})
|
||||
|
||||
it('should broadcast the token change too', function () {
|
||||
return this.EditorRealTimeController.emitToRoom
|
||||
.calledWith(this.project_id, 'project:tokens:changed', {
|
||||
tokens: this.tokens,
|
||||
})
|
||||
.should.equal(true)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@@ -113,7 +113,6 @@ describe('EditorHttpController', function () {
|
||||
this.Metrics = { inc: sinon.stub() }
|
||||
this.TokenAccessHandler = {
|
||||
getRequestToken: sinon.stub().returns(this.token),
|
||||
protectTokens: sinon.stub(),
|
||||
}
|
||||
this.SessionManager = {
|
||||
getLoggedInUserId: sinon.stub().returns(this.user._id),
|
||||
|
||||
Reference in New Issue
Block a user