Files
Portfolio/src/legacy-service-redirects.spec.ts
Antonio Ledebuhr a9ad7eb1a7 Rewrite the constraint specs and docs for the service-led information architecture.
Assertions now follow the eighteen prerenderable paths, the gist dialog, and the six-case evidence set.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-27 00:41:24 +02:00

53 lines
2.2 KiB
TypeScript

import { LEGACY_SERVICE_REDIRECTS, normalizeRequestPath } from './legacy-service-redirects';
import { prerenderablePaths } from './app/core/routing/route-paths';
describe('legacy service redirects', () => {
it('maps exactly eight retired service URLs onto services fragments', () => {
expect(Object.keys(LEGACY_SERVICE_REDIRECTS)).toEqual([
'/leistungen/software',
'/leistungen/hardware-netzwerk',
'/leistungen/cluster',
'/leistungen/ai-integration',
'/en/services/software',
'/en/services/hardware-network',
'/en/services/clusters',
'/en/services/ai-integration',
]);
expect(LEGACY_SERVICE_REDIRECTS['/leistungen/software']).toBe('/leistungen#software-data');
expect(LEGACY_SERVICE_REDIRECTS['/leistungen/hardware-netzwerk']).toBe(
'/leistungen#infrastructure-network',
);
expect(LEGACY_SERVICE_REDIRECTS['/leistungen/cluster']).toBe('/leistungen#platform-operations');
expect(LEGACY_SERVICE_REDIRECTS['/leistungen/ai-integration']).toBe('/leistungen#ai-workflows');
expect(LEGACY_SERVICE_REDIRECTS['/en/services/software']).toBe('/en/services#software-data');
expect(LEGACY_SERVICE_REDIRECTS['/en/services/hardware-network']).toBe(
'/en/services#infrastructure-network',
);
expect(LEGACY_SERVICE_REDIRECTS['/en/services/clusters']).toBe(
'/en/services#platform-operations',
);
expect(LEGACY_SERVICE_REDIRECTS['/en/services/ai-integration']).toBe(
'/en/services#ai-workflows',
);
});
it('treats an optional trailing slash as the same path', () => {
expect(normalizeRequestPath('/leistungen/software/')).toBe('/leistungen/software');
expect(normalizeRequestPath('/en/services/ai-integration/')).toBe(
'/en/services/ai-integration',
);
expect(normalizeRequestPath('/')).toBe('/');
expect(LEGACY_SERVICE_REDIRECTS[normalizeRequestPath('/leistungen/cluster/')]).toBe(
'/leistungen#platform-operations',
);
});
it('keeps the eight legacy paths out of prerenderablePaths', () => {
const paths = prerenderablePaths();
expect(paths).toHaveLength(18);
for (const from of Object.keys(LEGACY_SERVICE_REDIRECTS)) {
expect(paths, from).not.toContain(from);
}
});
});