Merge branch 'feat/inda-383-daily-stat' into 'main'
[ProtonMail-WebClient.git] / packages / activation / src / tests / data / addresses.ts
blob79e73bf175e585375af8c1468a5bcdcadc561dcb
1 import type { ADDRESS_TYPE } from '@proton/shared/lib/constants';
2 import type { Address, AddressKey } from '@proton/shared/lib/interfaces';
4 const activeKey: AddressKey = {
5     ID: 'key',
6     Primary: 1,
7     Active: 1,
8     Fingerprint: 'fingerprint',
9     Fingerprints: [],
10     PublicKey: 'PublicKey',
11     Version: 1,
12     PrivateKey: 'PrivateKey',
13     Signature: 'signature',
14     RecoverySecret: null,
15     RecoverySecretSignature: null,
16     Flags: 1,
17     AddressForwardingID: 'AddressForwardingID',
20 const disabledKey: AddressKey = {
21     ...activeKey,
22     Active: 0,
25 export const generateMockAddress = (n: number, keyActive: boolean, type?: ADDRESS_TYPE): Address => {
26     return {
27         DisplayName: `Testing ${n}`,
28         DomainID: 'proton.ch',
29         Email: `testing${n}@proton.ch`,
30         HasKeys: 1,
31         ID: `ID-${n}`,
32         Keys: [keyActive ? activeKey : disabledKey],
33         SignedKeyList: null,
34         Order: 1,
35         Priority: 1,
36         Receive: 1,
37         Send: 1,
38         Permissions: 0,
39         Signature: 'Testing signature',
40         Status: 1,
41         Type: type ?? 1,
42         ProtonMX: true,
43         ConfirmationState: 1,
44         CatchAll: false,
45     };
48 export const generateMockAddressArray = (n: number, keyActive: boolean, type?: ADDRESS_TYPE) => {
49     return Array.from(Array(n)).map((_, i) => generateMockAddress(i, keyActive, type));