Merge branch 'translations_2024-12-05_050340' into 'main'
[ProtonMail-WebClient.git] / packages / pass / lib / vaults / vault-proto.transformer.spec.ts
blob6b7c06f58c4d28188c4fec5afe49bf5204d04389
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),
11             display: {},
12         };
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);
20     });
21 });