1 import type { ShareContent, ShareType } from '@proton/pass/types';
2 import getRandomString from '@proton/utils/getRandomString';
4 import { decodeVaultContent, encodeVaultContent } from './vault-proto.transformer';
6 describe('VaultContentTransformer', () => {
7 it('should be able to encode and decode', () => {
8 const source: ShareContent<ShareType.Vault> = {
9 name: getRandomString(10),
10 description: getRandomString(10),
14 const encoded = encodeVaultContent(source);
15 expect(encoded.length).toBeGreaterThan(0);
17 const decoded = decodeVaultContent(encoded);
18 expect(decoded.name).toStrictEqual(source.name);
19 expect(decoded.description).toStrictEqual(source.description);