Skip to content

Commit 41d0bb6

Browse files
author
Myztiq
committed
Fixed tough merge.
1 parent f84aa23 commit 41d0bb6

2 files changed

Lines changed: 16 additions & 14 deletions

File tree

client/controllers/controllerApp.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,9 @@ function ControllerApp(
120120
}
121121
};
122122

123-
if ($rootScope.featureFlags.billing && (activeAccount.isInGrace() || activeAccount.isGraceExpired())) {
123+
if ($rootScope.featureFlags.billing && (currentOrg.poppa.isInGrace() || currentOrg.poppa.isGraceExpired())) {
124124
// Determine if it's a trial end or just a normal payment due
125-
if (activeAccount.attrs.hasPaymentMethod) {
125+
if (currentOrg.poppa.attrs.hasPaymentMethod) {
126126
ModalService.showModal({
127127
controller: 'ExpiredAccountController',
128128
controllerAs: 'EAC',

test/unit/controllers/controllerApp.unit.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ describe('controllerApp'.bold.underline.blue, function () {
2929
poppa: {
3030
trialDaysRemaining: sinon.stub(),
3131
isInTrial: sinon.stub(),
32+
isInGrace: sinon.stub(),
33+
isGraceExpired: sinon.stub(),
3234
attrs: {
3335
hasPaymentMethod: false
3436
}
@@ -204,9 +206,9 @@ describe('controllerApp'.bold.underline.blue, function () {
204206
beforeEach(function () {
205207
var controllerSetupFn = setup(true);
206208
mockFeatureFlags.flags.billing = true;
207-
ctx.fakeuser.isInGrace.returns(true);
208-
ctx.fakeuser.isGraceExpired.returns(false);
209-
ctx.fakeuser.attrs.hasPaymentMethod = true;
209+
mockCurrentOrg.poppa.isInGrace.returns(true);
210+
mockCurrentOrg.poppa.isGraceExpired.returns(false);
211+
mockCurrentOrg.poppa.attrs.hasPaymentMethod = true;
210212
controllerSetupFn();
211213
$rootScope.$digest();
212214
});
@@ -225,9 +227,9 @@ describe('controllerApp'.bold.underline.blue, function () {
225227
beforeEach(function () {
226228
var controllerSetupFn = setup(true);
227229
mockFeatureFlags.flags.billing = true;
228-
ctx.fakeuser.isInGrace.returns(true);
229-
ctx.fakeuser.isGraceExpired.returns(false);
230-
ctx.fakeuser.attrs.hasPaymentMethod = false;
230+
mockCurrentOrg.poppa.isInGrace.returns(true);
231+
mockCurrentOrg.poppa.isGraceExpired.returns(false);
232+
mockCurrentOrg.poppa.attrs.hasPaymentMethod = false;
231233
controllerSetupFn();
232234
$rootScope.$digest();
233235
});
@@ -249,9 +251,9 @@ describe('controllerApp'.bold.underline.blue, function () {
249251
beforeEach(function () {
250252
var controllerSetupFn = setup(true);
251253
mockFeatureFlags.flags.billing = true;
252-
ctx.fakeuser.isInGrace.returns(false);
253-
ctx.fakeuser.isGraceExpired.returns(true);
254-
ctx.fakeuser.attrs.hasPaymentMethod = true;
254+
mockCurrentOrg.poppa.isInGrace.returns(false);
255+
mockCurrentOrg.poppa.isGraceExpired.returns(true);
256+
mockCurrentOrg.poppa.attrs.hasPaymentMethod = true;
255257
controllerSetupFn();
256258
$rootScope.$digest();
257259
});
@@ -271,9 +273,9 @@ describe('controllerApp'.bold.underline.blue, function () {
271273
beforeEach(function () {
272274
var controllerSetupFn = setup(true);
273275
mockFeatureFlags.flags.billing = true;
274-
ctx.fakeuser.isInGrace.returns(false);
275-
ctx.fakeuser.isGraceExpired.returns(true);
276-
ctx.fakeuser.attrs.hasPaymentMethod = false;
276+
mockCurrentOrg.poppa.isInGrace.returns(false);
277+
mockCurrentOrg.poppa.isGraceExpired.returns(true);
278+
mockCurrentOrg.poppa.attrs.hasPaymentMethod = false;
277279
controllerSetupFn();
278280
$rootScope.$digest();
279281
});

0 commit comments

Comments
 (0)