Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / shared / test / contacts / address.spec.ts
blobb375d12291818a1b45d6eceb5d99e542d228df64
1 import { cleanAddressFromCommas } from '@proton/shared/lib/contacts/helpers/address';
2 import type { VCardAddress } from '@proton/shared/lib/interfaces/contacts/VCard';
4 describe('contact address helpers', () => {
5     describe('cleanAddressFromCommas', () => {
6         it('should clean commas from address fields', () => {
7             const address: VCardAddress = {
8                 streetAddress: 'streetAddress',
9                 extendedAddress: ',,,something, somewhere,,',
10                 postalCode: '000',
11                 postOfficeBox: ',,something,somewhere,Geneva,000,,,,,,',
12                 locality: ',locality,',
13                 region: ',,,Geneva',
14                 country: 'Switzerland,,,',
15             };
17             const expectedAddress: VCardAddress = {
18                 streetAddress: 'streetAddress',
19                 extendedAddress: 'something, somewhere',
20                 postalCode: '000',
21                 postOfficeBox: 'something,somewhere,Geneva,000',
22                 locality: 'locality',
23                 region: 'Geneva',
24                 country: 'Switzerland',
25             };
27             expect(cleanAddressFromCommas(address)).toEqual(expectedAddress);
28         });
29     });
30 });