Files
carmanagement/apps/homepage/tests/unit/pricing.test.ts
T
root e51c44f486
Build & Push / Pipeline Tests (push) Successful in 1m51s
Test / Type Check (all packages) (push) Successful in 51s
Build & Push / Build & Push Docker Image (push) Failing after 4m11s
Test / API Unit Tests (push) Successful in 1m15s
Test / Homepage Unit Tests (push) Successful in 49s
Test / Carplace Unit Tests (push) Successful in 43s
Test / Admin Unit Tests (push) Successful in 42s
Test / Dashboard Unit Tests (push) Successful in 43s
Test / API Integration Tests (push) Successful in 1m5s
fix pricing at home page
2026-08-08 01:16:44 -04:00

30 lines
1.3 KiB
TypeScript

import { buildHomepageContent } from '@/content/homepage-model';
import enHomepage from '@/content/locales/en/homepage.json';
import enShell from '@/content/locales/en/shell.json';
import { pricingCommercialConfig } from '@/content/pricing-config';
import { describe, expect, it } from 'vitest';
describe('homepage pricing configuration', () => {
it('keeps commercial values in one guarded configuration', () => {
expect(pricingCommercialConfig.publicPricesApproved).toBe(true);
expect(pricingCommercialConfig.currency).toBe('MAD');
expect(pricingCommercialConfig.annualDiscountPercent).toBe(20);
expect(pricingCommercialConfig.monthlyPrices.launch.small).toBe(149);
expect(pricingCommercialConfig.monthlyPrices.growth.growing).toBe(299);
expect(pricingCommercialConfig.monthlyPrices.enterprise.enterprise).toBeNull();
expect(pricingCommercialConfig.recommendedPlanByFleetBand.scale).toBe('growth');
});
it('maps every fleet band and plan from localized content', () => {
const pricing = buildHomepageContent(enHomepage, enShell).pricing;
expect(pricing.fleetBands.map((band) => band.id)).toEqual([
'small',
'growing',
'scale',
'enterprise',
]);
expect(pricing.plans.map((plan) => plan.id)).toEqual(['launch', 'growth', 'enterprise']);
});
});