test for rate service
This commit is contained in:
parent
da8aa18a1b
commit
cf143898f9
2 changed files with 20 additions and 2 deletions
0
test/run.sh
Normal file → Executable file
0
test/run.sh
Normal file → Executable file
|
|
@ -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…
Add table
Add a link
Reference in a new issue