Merge pull request #3495 from overleaf/ae-prettier-2

Upgrade Prettier to v2

GitOrigin-RevId: 85aa3fa1acb6332c4f58c46165a43d1a51471f33
This commit is contained in:
Alf Eaton
2021-04-14 14:17:21 +01:00
committed by Copybot
parent 930d7ba028
commit 1ebc8a79cb
582 changed files with 20382 additions and 20374 deletions
@@ -299,8 +299,8 @@ const expectInvitesInJoinProjectCount = (user, projectId, count, callback) => {
})
}
describe('ProjectInviteTests', function() {
beforeEach(function(done) {
describe('ProjectInviteTests', function () {
beforeEach(function (done) {
this.sendingUser = new User()
this.user = new User()
this.site_admin = new User({ email: 'admin@example.com' })
@@ -316,13 +316,13 @@ describe('ProjectInviteTests', function() {
)
})
describe('creating invites', function() {
beforeEach(function() {
describe('creating invites', function () {
beforeEach(function () {
this.projectName = 'wat'
})
describe('creating two invites', function() {
beforeEach(function(done) {
describe('creating two invites', function () {
beforeEach(function (done) {
createProject(
this.sendingUser,
this.projectName,
@@ -335,7 +335,7 @@ describe('ProjectInviteTests', function() {
)
})
it('should allow the project owner to create and remove invites', function(done) {
it('should allow the project owner to create and remove invites', function (done) {
Async.series(
[
cb => expectProjectAccess(this.sendingUser, this.projectId, cb),
@@ -414,7 +414,7 @@ describe('ProjectInviteTests', function() {
)
})
it('should allow the project owner to create many invites at once', function(done) {
it('should allow the project owner to create many invites at once', function (done) {
Async.series(
[
cb => expectProjectAccess(this.sendingUser, this.projectId, cb),
@@ -488,8 +488,8 @@ describe('ProjectInviteTests', function() {
})
})
describe('clicking the invite link', function() {
beforeEach(function(done) {
describe('clicking the invite link', function () {
beforeEach(function (done) {
createProjectAndInvite(
this.sendingUser,
this.projectName,
@@ -505,13 +505,13 @@ describe('ProjectInviteTests', function() {
)
})
describe('user is logged in already', function() {
beforeEach(function(done) {
describe('user is logged in already', function () {
beforeEach(function (done) {
this.user.login(done)
})
describe('user is already a member of the project', function() {
beforeEach(function(done) {
describe('user is already a member of the project', function () {
beforeEach(function (done) {
Async.series(
[
cb => expectInvitePage(this.user, this.link, cb),
@@ -522,8 +522,8 @@ describe('ProjectInviteTests', function() {
)
})
describe('when user clicks on the invite a second time', function() {
it('should just redirect to the project page', function(done) {
describe('when user clicks on the invite a second time', function () {
it('should just redirect to the project page', function (done) {
Async.series(
[
cb => expectProjectAccess(this.user, this.invite.projectId, cb),
@@ -540,8 +540,8 @@ describe('ProjectInviteTests', function() {
)
})
describe('when the user recieves another invite to the same project', function() {
it('should redirect to the project page', function(done) {
describe('when the user recieves another invite to the same project', function () {
it('should redirect to the project page', function (done) {
Async.series(
[
cb => {
@@ -586,8 +586,8 @@ describe('ProjectInviteTests', function() {
})
})
describe('user is not a member of the project', function() {
it('should not grant access if the user does not accept the invite', function(done) {
describe('user is not a member of the project', function () {
it('should not grant access if the user does not accept the invite', function (done) {
Async.series(
[
cb => expectInvitePage(this.user, this.link, cb),
@@ -597,7 +597,7 @@ describe('ProjectInviteTests', function() {
)
})
it('should render the invalid-invite page if the token is invalid', function(done) {
it('should render the invalid-invite page if the token is invalid', function (done) {
Async.series(
[
cb => {
@@ -614,7 +614,7 @@ describe('ProjectInviteTests', function() {
)
})
it('should allow the user to accept the invite and access the project', function(done) {
it('should allow the user to accept the invite and access the project', function (done) {
Async.series(
[
cb => expectInvitePage(this.user, this.link, cb),
@@ -627,19 +627,19 @@ describe('ProjectInviteTests', function() {
})
})
describe('user is not logged in initially', function() {
describe('registration prompt workflow with valid token', function() {
before(function() {
describe('user is not logged in initially', function () {
describe('registration prompt workflow with valid token', function () {
before(function () {
if (!Features.hasFeature('public-registration')) {
this.skip()
}
})
it('should redirect to the register page', function(done) {
it('should redirect to the register page', function (done) {
expectInviteRedirectToRegister(this.user, this.link, done)
})
it('should allow user to accept the invite if the user registers a new account', function(done) {
it('should allow user to accept the invite if the user registers a new account', function (done) {
Async.series(
[
cb => expectInviteRedirectToRegister(this.user, this.link, cb),
@@ -659,14 +659,14 @@ describe('ProjectInviteTests', function() {
})
})
describe('registration prompt workflow with non-valid token', function() {
before(function() {
describe('registration prompt workflow with non-valid token', function () {
before(function () {
if (!Features.hasFeature('public-registration')) {
this.skip()
}
})
it('should redirect to the register page', function(done) {
it('should redirect to the register page', function (done) {
Async.series(
[
cb => expectInviteRedirectToRegister(this.user, this.link, cb),
@@ -676,7 +676,7 @@ describe('ProjectInviteTests', function() {
)
})
it('should display invalid-invite if the user registers a new account', function(done) {
it('should display invalid-invite if the user registers a new account', function (done) {
const badLink = this.link.replace(
this.invite.token,
'not_a_real_token'
@@ -699,8 +699,8 @@ describe('ProjectInviteTests', function() {
})
})
describe('login workflow with valid token', function() {
it('should redirect to the register page', function(done) {
describe('login workflow with valid token', function () {
it('should redirect to the register page', function (done) {
Async.series(
[
cb => expectInviteRedirectToRegister(this.user, this.link, cb),
@@ -710,7 +710,7 @@ describe('ProjectInviteTests', function() {
)
})
it('should allow the user to login to view the invite', function(done) {
it('should allow the user to login to view the invite', function (done) {
Async.series(
[
cb => expectInviteRedirectToRegister(this.user, this.link, cb),
@@ -723,7 +723,7 @@ describe('ProjectInviteTests', function() {
)
})
it('should allow user to accept the invite if the user logs in', function(done) {
it('should allow user to accept the invite if the user logs in', function (done) {
Async.series(
[
cb => expectInviteRedirectToRegister(this.user, this.link, cb),
@@ -738,8 +738,8 @@ describe('ProjectInviteTests', function() {
})
})
describe('login workflow with non-valid token', function() {
it('should redirect to the register page', function(done) {
describe('login workflow with non-valid token', function () {
it('should redirect to the register page', function (done) {
Async.series(
[
cb => expectInviteRedirectToRegister(this.user, this.link, cb),
@@ -749,7 +749,7 @@ describe('ProjectInviteTests', function() {
)
})
it('should show the invalid-invite page once the user has logged in', function(done) {
it('should show the invalid-invite page once the user has logged in', function (done) {
const badLink = this.link.replace(
this.invite.token,
'not_a_real_token'