Merge pull request #3496 from overleaf/ae-eslint-dot-notation
Enable the eslint dot-notation rule GitOrigin-RevId: e11cbad3e8a77a4a60590d3674fbf34feccc5bc9
This commit is contained in:
@@ -87,7 +87,7 @@ describe('AnalyticsController', function() {
|
||||
this.AuthenticationController.getLoggedInUserId.returns('1234')
|
||||
this.controller.recordEvent(this.req, this.res)
|
||||
this.AnalyticsManager.recordEvent
|
||||
.calledWith('1234', this.req.params['event'], this.req.body)
|
||||
.calledWith('1234', this.req.params.event, this.req.body)
|
||||
.should.equal(true)
|
||||
done()
|
||||
})
|
||||
@@ -95,7 +95,7 @@ describe('AnalyticsController', function() {
|
||||
it('should use the session id', function(done) {
|
||||
this.controller.recordEvent(this.req, this.res)
|
||||
this.AnalyticsManager.recordEvent
|
||||
.calledWith(this.req.sessionID, this.req.params['event'], this.req.body)
|
||||
.calledWith(this.req.sessionID, this.req.params.event, this.req.body)
|
||||
.should.equal(true)
|
||||
done()
|
||||
})
|
||||
@@ -119,10 +119,10 @@ describe('AnalyticsController', function() {
|
||||
this.controller.licences(this.req, this.res)
|
||||
this.InstitutionsAPI.getInstitutionLicences
|
||||
.calledWith(
|
||||
this.req.query['resource_id'],
|
||||
this.req.query['start_date'],
|
||||
this.req.query['end_date'],
|
||||
this.req.query['lag']
|
||||
this.req.query.resource_id,
|
||||
this.req.query.start_date,
|
||||
this.req.query.end_date,
|
||||
this.req.query.lag
|
||||
)
|
||||
.should.equal(true)
|
||||
done()
|
||||
|
||||
@@ -685,7 +685,7 @@ describe('AuthenticationController', function() {
|
||||
|
||||
describe('with http auth', function() {
|
||||
beforeEach(function() {
|
||||
this.req.headers['authorization'] = 'Mock Basic Auth'
|
||||
this.req.headers.authorization = 'Mock Basic Auth'
|
||||
this.AuthenticationController.requireGlobalLogin(
|
||||
this.req,
|
||||
this.res,
|
||||
@@ -898,12 +898,10 @@ describe('AuthenticationController', function() {
|
||||
})
|
||||
|
||||
it("should update the user's login count and last logged in date", function() {
|
||||
this.UserUpdater.updateUser.args[0][1]['$set'][
|
||||
'lastLoggedIn'
|
||||
].should.not.equal(undefined)
|
||||
this.UserUpdater.updateUser.args[0][1]['$inc']['loginCount'].should.equal(
|
||||
1
|
||||
this.UserUpdater.updateUser.args[0][1].$set.lastLoggedIn.should.not.equal(
|
||||
undefined
|
||||
)
|
||||
this.UserUpdater.updateUser.args[0][1].$inc.loginCount.should.equal(1)
|
||||
})
|
||||
|
||||
it('should call the callback', function() {
|
||||
|
||||
@@ -149,7 +149,7 @@ describe('ChatController', function() {
|
||||
}
|
||||
sinon.spy(this.UserInfoManager, 'getPersonalInfo')
|
||||
return (this.UserInfoController.formatPersonalInfo = user => ({
|
||||
formatted: user['mock']
|
||||
formatted: user.mock
|
||||
}))
|
||||
})
|
||||
|
||||
|
||||
@@ -363,7 +363,7 @@ describe('FileStoreHandler', function() {
|
||||
this.request.callCount.should.equal(1)
|
||||
const { headers } = this.request.firstCall.args[0]
|
||||
expect(headers).to.have.keys('range')
|
||||
expect(headers['range']).to.equal('bytes=0-10')
|
||||
expect(headers.range).to.equal('bytes=0-10')
|
||||
done()
|
||||
}
|
||||
)
|
||||
|
||||
@@ -185,7 +185,7 @@ describe('HistoryController', function() {
|
||||
describe('with an error', function() {
|
||||
beforeEach(function() {
|
||||
this.HistoryController.proxyToHistoryApi(this.req, this.res, this.next)
|
||||
return this.proxy.events['error'].call(
|
||||
return this.proxy.events.error.call(
|
||||
this.proxy,
|
||||
(this.error = new Error('oops'))
|
||||
)
|
||||
|
||||
@@ -117,8 +117,8 @@ describe('InstitutionsAPI', function() {
|
||||
const expectedUrl = `v1.url/api/v2/institutions/${this.institutionId}/institution_licences`
|
||||
requestOptions.url.should.equal(expectedUrl)
|
||||
requestOptions.method.should.equal('GET')
|
||||
requestOptions.body['start_date'].should.equal(startDate)
|
||||
requestOptions.body['end_date'].should.equal(endDate)
|
||||
requestOptions.body.start_date.should.equal(startDate)
|
||||
requestOptions.body.end_date.should.equal(endDate)
|
||||
requestOptions.body.lag.should.equal('monthly')
|
||||
body.should.equal(responseBody)
|
||||
return done()
|
||||
|
||||
@@ -343,14 +343,14 @@ describe('UserMembershipController', function() {
|
||||
describe('create', function() {
|
||||
beforeEach(function() {
|
||||
this.req.params.name = 'institution'
|
||||
this.req.entityConfig = EntityConfigs['institution']
|
||||
this.req.entityConfig = EntityConfigs.institution
|
||||
return (this.req.params.id = 123)
|
||||
})
|
||||
|
||||
it('creates institution', function(done) {
|
||||
return this.UserMembershipController.create(this.req, {
|
||||
redirect: path => {
|
||||
expect(path).to.eq(EntityConfigs['institution'].pathsFor(123).index)
|
||||
expect(path).to.eq(EntityConfigs.institution.pathsFor(123).index)
|
||||
sinon.assert.calledWithMatch(
|
||||
this.UserMembershipHandler.createEntity,
|
||||
123,
|
||||
|
||||
Reference in New Issue
Block a user