mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-26 18:51:50 +02:00
Merge pull request #3495 from overleaf/ae-prettier-2
Upgrade Prettier to v2 GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
@@ -30,17 +30,17 @@ const _ = require('lodash')
|
||||
// It is tested that these methods DO work when the lock has not been taken in
|
||||
// other acceptance tests.
|
||||
|
||||
describe('ProjectStructureMongoLock', function() {
|
||||
describe('whilst a project lock is taken', function() {
|
||||
describe('ProjectStructureMongoLock', function () {
|
||||
describe('whilst a project lock is taken', function () {
|
||||
let oldMaxLockWaitTime
|
||||
before(function() {
|
||||
before(function () {
|
||||
oldMaxLockWaitTime = LockManager.MAX_LOCK_WAIT_TIME
|
||||
})
|
||||
after(function() {
|
||||
after(function () {
|
||||
LockManager.MAX_LOCK_WAIT_TIME = oldMaxLockWaitTime
|
||||
})
|
||||
|
||||
beforeEach(function(done) {
|
||||
beforeEach(function (done) {
|
||||
// We want to instantly fail if the lock is taken
|
||||
LockManager.MAX_LOCK_WAIT_TIME = 1
|
||||
this.lockValue = 'lock-value'
|
||||
@@ -76,11 +76,11 @@ describe('ProjectStructureMongoLock', function() {
|
||||
})
|
||||
})
|
||||
|
||||
after(function(done) {
|
||||
after(function (done) {
|
||||
return LockManager._releaseLock(this.lock_key, this.lockValue, done)
|
||||
})
|
||||
|
||||
describe('interacting with the locked project', function() {
|
||||
describe('interacting with the locked project', function () {
|
||||
const LOCKING_UPDATE_METHODS = [
|
||||
'addDoc',
|
||||
'addFile',
|
||||
@@ -90,7 +90,7 @@ describe('ProjectStructureMongoLock', function() {
|
||||
'addFolder'
|
||||
]
|
||||
for (var methodName of Array.from(LOCKING_UPDATE_METHODS)) {
|
||||
it(`cannot call ProjectEntityMongoUpdateHandler.${methodName}`, function(done) {
|
||||
it(`cannot call ProjectEntityMongoUpdateHandler.${methodName}`, function (done) {
|
||||
const method = ProjectEntityMongoUpdateHandler[methodName]
|
||||
const args = _.times(method.length - 2, _.constant(null))
|
||||
return method(this.locked_project._id, args, err => {
|
||||
@@ -101,7 +101,7 @@ describe('ProjectStructureMongoLock', function() {
|
||||
})
|
||||
}
|
||||
|
||||
it('cannot get the project without a projection', function(done) {
|
||||
it('cannot get the project without a projection', function (done) {
|
||||
return ProjectGetter.getProject(this.locked_project._id, err => {
|
||||
expect(err).to.be.instanceOf(Error)
|
||||
expect(err).to.have.property('message', 'Timeout')
|
||||
@@ -109,7 +109,7 @@ describe('ProjectStructureMongoLock', function() {
|
||||
})
|
||||
})
|
||||
|
||||
it('cannot get the project if rootFolder is in the projection', function(done) {
|
||||
it('cannot get the project if rootFolder is in the projection', function (done) {
|
||||
return ProjectGetter.getProject(
|
||||
this.locked_project._id,
|
||||
{ rootFolder: true },
|
||||
@@ -121,7 +121,7 @@ describe('ProjectStructureMongoLock', function() {
|
||||
)
|
||||
})
|
||||
|
||||
it('can get the project if rootFolder is not in the projection', function(done) {
|
||||
it('can get the project if rootFolder is not in the projection', function (done) {
|
||||
return ProjectGetter.getProject(
|
||||
this.locked_project._id,
|
||||
{ _id: true },
|
||||
@@ -134,8 +134,8 @@ describe('ProjectStructureMongoLock', function() {
|
||||
})
|
||||
})
|
||||
|
||||
describe('interacting with other projects', function() {
|
||||
beforeEach(function(done) {
|
||||
describe('interacting with other projects', function () {
|
||||
beforeEach(function (done) {
|
||||
return ProjectCreationHandler.createBlankProject(
|
||||
this.user._id,
|
||||
'unlocked-project',
|
||||
@@ -149,7 +149,7 @@ describe('ProjectStructureMongoLock', function() {
|
||||
)
|
||||
})
|
||||
|
||||
it('can add folders to other projects', function(done) {
|
||||
it('can add folders to other projects', function (done) {
|
||||
return ProjectEntityMongoUpdateHandler.addFolder(
|
||||
this.unlocked_project._id,
|
||||
this.unlocked_project.rootFolder[0]._id,
|
||||
@@ -162,7 +162,7 @@ describe('ProjectStructureMongoLock', function() {
|
||||
)
|
||||
})
|
||||
|
||||
it('can get other projects without a projection', function(done) {
|
||||
it('can get other projects without a projection', function (done) {
|
||||
return ProjectGetter.getProject(
|
||||
this.unlocked_project._id,
|
||||
(err, project) => {
|
||||
|
||||
Reference in New Issue
Block a user