Skip to content

Commit 912f2bb

Browse files
author
Myztiq
committed
Updated tests.
1 parent c012cfd commit 912f2bb

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

test/unit/directives/directiveAccountsSelect.unit.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,22 @@ describe('directiveAccountsSelect'.bold.underline.blue, function() {
153153
describe('when in trial', function () {
154154
beforeEach(function () {
155155
mockCurrentOrg.poppa.isInTrial.returns(true);
156-
mockCurrentOrg.poppa.trialDaysRemaining = sinon.stub().returns(12);
156+
mockCurrentOrg.poppa.trialDaysRemaining = sinon.stub().returns(2);
157157
});
158158

159159
it('should return trial remaining', function () {
160160
mockCurrentOrg.poppa.isInTrial.reset();
161161
mockCurrentOrg.poppa.trialDaysRemaining.reset();
162-
expect($elScope.getBadgeCount()).to.equal(12);
162+
expect($elScope.getBadgeCount()).to.equal(2);
163+
sinon.assert.calledOnce(mockCurrentOrg.poppa.isInTrial);
164+
sinon.assert.calledOnce(mockCurrentOrg.poppa.trialDaysRemaining);
165+
});
166+
167+
it('should return nothing if trial is greater than 3 days remaining', function () {
168+
mockCurrentOrg.poppa.trialDaysRemaining = sinon.stub().returns(12);
169+
mockCurrentOrg.poppa.isInTrial.reset();
170+
mockCurrentOrg.poppa.trialDaysRemaining.reset();
171+
expect($elScope.getBadgeCount()).to.equal('');
163172
sinon.assert.calledOnce(mockCurrentOrg.poppa.isInTrial);
164173
sinon.assert.calledOnce(mockCurrentOrg.poppa.trialDaysRemaining);
165174
});

0 commit comments

Comments
 (0)