1 import { getClientID } from '../../lib/apps/helper';
2 import type { APP_NAMES } from '../../lib/constants';
3 import { APPS } from '../../lib/constants';
4 import { getAppVersionHeaders } from '../../lib/fetch/headers';
6 describe('app version headers', () => {
7 it('should return new app headers', () => {
8 const test = (app: APP_NAMES, version: string, expectation: string) => {
9 expect(getAppVersionHeaders(getClientID(app), version)).toEqual({ 'x-pm-appversion': expectation });
12 for (const { app, version, expectation } of [
16 expectation: 'web-mail@4.999.999',
21 expectation: 'web-mail@4.14.6',
24 app: APPS.PROTONCALENDAR,
26 expectation: 'web-calendar@4.0.1',
29 app: APPS.PROTONVPN_SETTINGS,
31 expectation: 'web-vpn-settings@4.999.999',
34 app: APPS.PROTONVERIFICATION,
36 expectation: 'web-verify@4.1.0',
39 app: APPS.PROTONADMIN,
41 expectation: 'web-admin@4.12.12',
44 test(app, version, expectation);