mirror of https://github.com/BTCPrivate/copay.git
test for rate service
This commit is contained in:
parent
da8aa18a1b
commit
cf143898f9
|
@ -79,8 +79,6 @@ describe("Unit: controllerUtils", function() {
|
|||
expect($rootScope.addrInfos[0].address).to.be.equal(Waddr);;
|
||||
}));
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
describe("Unit: Notification Service", function() {
|
||||
|
@ -135,3 +133,23 @@ describe("Unit: uriHandler service", function() {
|
|||
}).should.not.throw();
|
||||
}));
|
||||
});
|
||||
|
||||
describe('Unit: Rate Service', function() {
|
||||
beforeEach(angular.mock.module('copayApp.services'));
|
||||
it('should be injected correctly', inject(function(rateService) {
|
||||
should.exist(rateService);
|
||||
}));
|
||||
it('should be possible to ask if it is available',
|
||||
inject(function(rateService) {
|
||||
should.exist(rateService.isAvailable);
|
||||
})
|
||||
);
|
||||
it('should be possible to ask for conversion',
|
||||
inject(function(rateService) {
|
||||
rateService.whenAvailable(function() {
|
||||
rateService.rates['LOL'] = 2;
|
||||
(1 * 1e8).should.equal(rateService.fromFiat(2, 'LOL'));
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue