Merge pull request #3914 from overleaf/jel-graphs-cached-licenses

Use cached affiliation data

GitOrigin-RevId: b8ae2b871cc1f3a11e61dd449b4d1ddc7835860d
This commit is contained in:
Jessica Lawshe
2021-04-27 02:09:28 +00:00
committed by Copybot
parent 4e9d7c36ff
commit 517485d7ea
2 changed files with 0 additions and 64 deletions
@@ -15,10 +15,6 @@ describe('AnalyticsController', function () {
recordEvent: sinon.stub()
}
this.InstitutionsAPI = {
getInstitutionLicences: sinon.stub().callsArgWith(4)
}
this.Features = {
hasFeature: sinon.stub().returns(true)
}
@@ -28,7 +24,6 @@ describe('AnalyticsController', function () {
'./AnalyticsManager': this.AnalyticsManager,
'../Authentication/AuthenticationController': this
.AuthenticationController,
'../Institutions/InstitutionsAPI': this.InstitutionsAPI,
'../../infrastructure/Features': this.Features,
'../../infrastructure/GeoIpLookup': (this.GeoIpLookup = {
getDetails: sinon.stub()
@@ -94,32 +89,4 @@ describe('AnalyticsController', function () {
done()
})
})
describe('licences', function () {
beforeEach(function () {
this.req = {
query: {
resource_id: 1,
start_date: '1514764800',
end_date: '1530662400',
resource_type: 'institution'
},
sessionID: 'sessionIDHere',
session: {}
}
})
it('should trigger institutions api to fetch licences graph data', function (done) {
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
)
.should.equal(true)
done()
})
})
})