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,,',
11 postOfficeBox: ',,something,somewhere,Geneva,000,,,,,,',
12 locality: ',locality,',
14 country: 'Switzerland,,,',
17 const expectedAddress: VCardAddress = {
18 streetAddress: 'streetAddress',
19 extendedAddress: 'something, somewhere',
21 postOfficeBox: 'something,somewhere,Geneva,000',
24 country: 'Switzerland',
27 expect(cleanAddressFromCommas(address)).toEqual(expectedAddress);