add tests

This commit is contained in:
Manuel Araoz 2014-06-16 17:40:59 -03:00
commit 4b81bc1fdb
3 changed files with 32 additions and 0 deletions

View file

@ -87,3 +87,24 @@ describe("Unit: controllerUtils", function() {
});
describe("Unit: Backup Service", function() {
var sinon = require('../sinon');
beforeEach(angular.mock.module('copayApp.services'));
it('should contain a backup service', inject(function(backupService) {
expect(backupService).not.to.equal(null);
}));
it('should backup in file', inject(function(backupService) {
var mock = sinon.mock(window);
var expectation = mock.expects('saveAs');
backupService.download(new FakeWallet());
expectation.once();
}));
it('should backup by email', inject(function(backupService) {
var mock = sinon.mock(window);
var expectation = mock.expects('open');
backupService.sendEmail('fake@test.com', new FakeWallet());
expectation.once();
}));
});