Merge pull request #26070 from overleaf/msm-disable-dropbox

[web] Disable Dropbox Capability

GitOrigin-RevId: 5f91d2918bf3b88e52f4d27c828a4715f9b88629
This commit is contained in:
Miguel Serrano
2025-06-20 08:05:20 +00:00
committed by Copybot
parent edf4fdda50
commit 04fa5366ce
19 changed files with 44 additions and 44 deletions
@@ -19,7 +19,6 @@ describe('<ChatPane />', function () {
beforeEach(function () {
window.metaAttributesCache.set('ol-user', user)
window.metaAttributesCache.set('ol-chatEnabled', true)
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
})
@@ -27,7 +27,6 @@ describe('ChatContext', function () {
stubMathJax()
window.metaAttributesCache.set('ol-user', user)
window.metaAttributesCache.set('ol-chatEnabled', true)
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
this.stub = sinon.stub(chatClientIdGenerator, 'generate').returns(uuidValue)
@@ -27,7 +27,6 @@ describe('<ToolbarHeader />', function () {
}
beforeEach(function () {
window.metaAttributesCache.set('ol-chatEnabled', true)
window.metaAttributesCache.set('ol-preventCompileOnLoad', true)
})
@@ -85,6 +85,8 @@ export function EditorProviders({
merge({}, defaultUserSettings, userSettings)
)
window.metaAttributesCache.set('ol-capabilities', ['chat', 'dropbox'])
const scope = merge(
{
user,
@@ -2,6 +2,7 @@ export function resetMeta() {
window.metaAttributesCache = new Map()
window.metaAttributesCache.set('ol-projectHistoryBlobsEnabled', true)
window.metaAttributesCache.set('ol-i18n', { currentLangCode: 'en' })
window.metaAttributesCache.set('ol-capabilities', ['chat', 'dropbox'])
window.metaAttributesCache.set('ol-ExposedSettings', {
appName: 'Overleaf',
maxEntitiesPerProject: 10,
@@ -300,6 +300,7 @@ describe('ProjectController', function () {
translate() {},
},
ip: '192.170.18.1',
capabilitySet: new Set(['chat']),
}
this.res = {
locals: {
@@ -1085,34 +1086,12 @@ describe('ProjectController', function () {
this.ProjectController.loadEditor(this.req, this.res)
})
describe('chatEnabled flag', function () {
it('should be set to false when the feature is disabled', function (done) {
describe('capabilitySet', function () {
it('should be passed as an array when loading the editor', 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
expect(opts.capabilities).to.deep.equal(['chat'])
done()
}
this.ProjectController.loadEditor(this.req, this.res)