Merge pull request #23026 from overleaf/mj-wc-settings-second-try

[web] Move write and cite setting storage

GitOrigin-RevId: 88a234c15b4dd2a9b451170e3b474d88bb6d45f7
This commit is contained in:
Mathias Jakobsen
2025-01-24 09:05:22 +00:00
committed by Copybot
parent 0d42173034
commit 77dd468c20
8 changed files with 44 additions and 0 deletions
@@ -425,6 +425,33 @@ describe('UserController', function () {
this.UserController.updateUserSettings(this.req, this.res)
})
it('should set referencesSearchMode to advanced', function (done) {
this.req.body = { referencesSearchMode: 'advanced' }
this.res.sendStatus = code => {
this.user.ace.referencesSearchMode.should.equal('advanced')
done()
}
this.UserController.updateUserSettings(this.req, this.res)
})
it('should set referencesSearchMode to simple', function (done) {
this.req.body = { referencesSearchMode: 'simple' }
this.res.sendStatus = code => {
this.user.ace.referencesSearchMode.should.equal('simple')
done()
}
this.UserController.updateUserSettings(this.req, this.res)
})
it('should not allow arbitrary referencesSearchMode', function (done) {
this.req.body = { referencesSearchMode: 'foobar' }
this.res.sendStatus = code => {
this.user.ace.referencesSearchMode.should.equal('advanced')
done()
}
this.UserController.updateUserSettings(this.req, this.res)
})
it('should send an error if the email is 0 len', function (done) {
this.req.body.email = ''
this.res.sendStatus = function (code) {