Merge pull request #4006 from overleaf/jel-refresh-features-reason

Pass reason to refreshFeatures

GitOrigin-RevId: 400e3081333239248e3408f93b0517b9bbdbc90c
This commit is contained in:
Jessica Lawshe
2021-05-12 02:09:55 +00:00
committed by Copybot
parent 2bf126af68
commit 5d7faa7977
12 changed files with 58 additions and 24 deletions
@@ -59,6 +59,7 @@ describe('FeaturesUpdater', function () {
it('should return features and featuresChanged', function () {
this.FeaturesUpdater.refreshFeatures(
this.user_id,
'test',
(err, features, featuresChanged) => {
expect(err).to.not.exist
expect(features).to.exist
@@ -69,7 +70,11 @@ describe('FeaturesUpdater', function () {
describe('normally', function () {
beforeEach(function () {
this.FeaturesUpdater.refreshFeatures(this.user_id, this.callback)
this.FeaturesUpdater.refreshFeatures(
this.user_id,
'test',
this.callback
)
})
it('should get the individual features', function () {
@@ -157,7 +162,11 @@ describe('FeaturesUpdater', function () {
this.FeaturesUpdater._mergeFeatures = sinon
.stub()
.returns({ dropbox: false })
this.FeaturesUpdater.refreshFeatures(this.user_id, this.callback)
this.FeaturesUpdater.refreshFeatures(
this.user_id,
'test',
this.callback
)
})
it('should fire module hook to unlink dropbox', function () {
this.Modules.hooks.fire
@@ -225,7 +225,7 @@ describe('SubscriptionUpdater', function () {
describe('_updateSubscriptionFromRecurly', function () {
beforeEach(function () {
this.FeaturesUpdater.refreshFeatures = sinon.stub().callsArgWith(1)
this.FeaturesUpdater.refreshFeatures = sinon.stub().callsArgWith(2)
this.SubscriptionUpdater.deleteSubscription = sinon.stub().yields()
})
@@ -441,7 +441,7 @@ describe('SubscriptionUpdater', function () {
describe('addUsersToGroup', function () {
beforeEach(function () {
this.FeaturesUpdater.refreshFeatures = sinon.stub().callsArgWith(1)
this.FeaturesUpdater.refreshFeatures = sinon.stub().callsArgWith(2)
})
it('should add the user ids to the group as a set', function (done) {
@@ -477,7 +477,7 @@ describe('SubscriptionUpdater', function () {
describe('removeUserFromGroups', function () {
beforeEach(function () {
this.FeaturesUpdater.refreshFeatures = sinon.stub().callsArgWith(1)
this.FeaturesUpdater.refreshFeatures = sinon.stub().callsArgWith(2)
this.UserGetter.getUser.yields(null, {})
this.fakeSubscriptions = [{ _id: 'fake-id-1' }, { _id: 'fake-id-2' }]
this.SubscriptionLocator.getMemberSubscriptions.yields(