mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-02 05:41:33 +02:00
Merge pull request #23006 from overleaf/msm-chat-capabilities-poc-2
[web] Add option to disable chat for subscription GitOrigin-RevId: 0052d060c74c39400496f7f9f54c820398d60012
This commit is contained in:
@@ -1132,6 +1132,40 @@ describe('ProjectController', function () {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('chatEnabled flag', function () {
|
||||
it('should be set to false when the feature is disabled', function (done) {
|
||||
this.Features.hasFeature = sinon.stub().withArgs('chat').returns(false)
|
||||
|
||||
this.res.render = (pageName, opts) => {
|
||||
expect(opts.chatEnabled).to.be.false
|
||||
done()
|
||||
}
|
||||
this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should be set to false when the feature is enabled but the capability is not available', function (done) {
|
||||
this.Features.hasFeature = sinon.stub().withArgs('chat').returns(false)
|
||||
this.req.capabilitySet = new Set()
|
||||
|
||||
this.res.render = (pageName, opts) => {
|
||||
expect(opts.chatEnabled).to.be.false
|
||||
done()
|
||||
}
|
||||
this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
|
||||
it('should be set to true when the feature is enabled and the capability is available', function (done) {
|
||||
this.Features.hasFeature = sinon.stub().withArgs('chat').returns(true)
|
||||
this.req.capabilitySet = new Set(['chat'])
|
||||
|
||||
this.res.render = (pageName, opts) => {
|
||||
expect(opts.chatEnabled).to.be.true
|
||||
done()
|
||||
}
|
||||
this.ProjectController.loadEditor(this.req, this.res)
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('userProjectsJson', function () {
|
||||
|
||||
Reference in New Issue
Block a user