Cleanup - unused files / unused exports / duplicate exports
[ProtonMail-WebClient.git] / packages / components / containers / vpn / OpenVPNConfigurationSection / normalizeName.spec.ts
blob19b64184ebfe55f7cc143f8dfce4caddca21805a
1 import type { Logical } from '@proton/shared/lib/vpn/Logical';
3 import { normalizeName } from './normalizeName';
5 describe('normalizeName', () => {
6     it('lowercase and convert # to -', () => {
7         expect(normalizeName({ Name: 'DE#96', Tier: 2 } as Logical)).toBe('de-96');
8     });
9     it('add free if Tier is 0', () => {
10         expect(normalizeName({ Name: 'DE#96', Tier: 0 } as Logical)).toBe('de-free-96');
11     });
12     it('keep free if already in the name', () => {
13         expect(normalizeName({ Name: 'DE-FREE#96', Tier: 0 } as Logical)).toBe('de-free-96');
14     });
15     it('pad with zero if number less than ten', () => {
16         expect(normalizeName({ Name: 'DE#6', Tier: 2 } as Logical)).toBe('de-06');
17     });
18     it('suffix with free non standard names', () => {
19         expect(normalizeName({ Name: 'DE#PARTNER', Tier: 0 } as Logical)).toBe('de-partner-free');
20     });
21     it('empty stay empty whatever the tier', () => {
22         expect(normalizeName({ Name: '', Tier: 0 } as Logical)).toBe('');
23         expect(normalizeName({ Name: '', Tier: 2 } as Logical)).toBe('');
24     });
25 });