1 import { SharesKeysStorage } from './useSharesKeys';
3 describe('useSharesKeys', () => {
4 let keys: SharesKeysStorage;
7 keys = new SharesKeysStorage();
10 it('returns empty passphrase when not set', () => {
11 // @ts-ignore: We simplify types in tests, so we don't have to construct OpenPGP key.
12 keys.set('shareId', 'pk', 'sk');
13 const passphrase = keys.get('missingShareId');
14 expect(passphrase).toBe(undefined);
17 it('returns the cached passphrase', () => {
18 // @ts-ignore: We simplify types in tests, so we don't have to construct OpenPGP key.
19 keys.set('shareId', 'pk', 'sk');
20 const passphrase = keys.get('shareId');
21 expect(passphrase).toMatchObject({