mirror of https://github.com/BTCPrivate/copay.git
tests
This commit is contained in:
parent
24cd875ca7
commit
3649d5c54a
|
@ -1,6 +1,6 @@
|
|||
import { TestBed, inject } from '@angular/core/testing';
|
||||
import { PersistenceProvider } from './persistence';
|
||||
import { IStorage, ISTORAGE } from './storage/istorage';
|
||||
import { IStorage, ISTORAGE, KeyAlreadyExistsError } from './storage/istorage';
|
||||
import { RamStorage } from './storage/ram-storage';
|
||||
|
||||
describe('Storage Service', () => {
|
||||
|
@ -26,5 +26,14 @@ describe('Storage Service', () => {
|
|||
});
|
||||
});
|
||||
}));
|
||||
it('should fail to create a profile when one already exists', inject([PersistenceProvider], (service: PersistenceProvider) => {
|
||||
var p = { name: 'My profile' };
|
||||
service.storeNewProfile(p, (err) => {
|
||||
expect(err).toBeNull;
|
||||
service.storeNewProfile(p, (err) => {
|
||||
expect(err.message).toEqual('Key already exists');
|
||||
});
|
||||
});
|
||||
}));
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue