Files
jobtrackingapp/job-tracker-ui/e2e/pre-p10-template-fixtures.ts
T

41 lines
3.2 KiB
TypeScript

import { emptyStructuredCv } from '../src/profileCv';
// Synthetic comparison corpus: each theme receives identical facts and marker membership.
export const templateFixtures = [
{ key: 'short-en', language: 'en', jobs: 1, bullets: 2, skills: 5 },
{ key: 'medium-nb', language: 'nb', jobs: 4, bullets: 3, skills: 12 },
{ key: 'long-en', language: 'en', jobs: 10, bullets: 4, skills: 25 },
{ key: 'dense-nb', language: 'nb', jobs: 12, bullets: 5, skills: 60 },
] as const;
export function templateProfile(sample: typeof templateFixtures[number]) {
const nb = sample.language === 'nb';
const profile = {
...emptyStructuredCv(),
contact: { ...emptyStructuredCv().contact,
fullName: 'S01 Åse Ødegård-Sørensen LangtEtternavn',
headline: nb ? 'S02 Senior plattformingeniør og fagansvarlig' : 'S02 Senior platform engineer and technical lead',
email: 'ase.odegard-sorensen.long-account-identifier@example.test', location: nb ? 'Tromsø, Norge' : 'Tromsø, Norway' },
summary: [nb ? 'S03 Bygger pålitelige tjenester med tydelig dokumentasjon, tilgjengelighet og målbare resultater.' : 'S03 Builds reliable services with clear documentation, accessibility and measurable results.'],
jobs: Array.from({ length: sample.jobs }, (_, index) => ({
id: `comparison-job-${index + 1}`,
title: `E${String(index + 1).padStart(2, '0')} ${nb ? 'Senior utvikler og teknisk rådgiver' : 'Senior software engineer and technical adviser'}`,
company: `${nb ? 'Eksempel Teknologi' : 'Example Technology'} ${index + 1}`,
startDate: `${2025 - index}-01`, endDate: index ? `${2026 - index}-01` : undefined, isCurrent: index === 0,
bullets: Array.from({ length: sample.bullets }, (_, detail) => {
const marker = `B${String(index * sample.bullets + detail + 1).padStart(2, '0')}`;
return nb ? `${marker} Forbedret stabile arbeidsflyter gjennom samarbeid, grundig testing og tilgjengelige grensesnitt for norske brukere. Dokumenterte ansvar, beslutninger og målbare resultater uten å miste historiske opplysninger.`
: `${marker} Improved reliable workflows through collaboration, thorough testing and accessible interfaces. Documented ownership, engineering decisions and measurable outcomes while preserving historical information.`;
}),
})),
skills: Array.from({ length: sample.skills }, (_, index) => `P${String(index + 1).padStart(2, '0')} ${['C# og .NET', 'React og TypeScript', 'Tilgjengelighet', 'Distribuerte systemer', 'PostgreSQL', 'Docker'][index % 6]}`),
// Short intentionally omits education; all fixtures omit optional phone/website/projects.
education: sample.key === 'short-en' ? [] : [{ id: 'comparison-education', qualification: 'R01 Master i informatikk', institution: 'Universitetet i Tromsø', startDate: '2014', endDate: '2019' }],
languages: [{ name: 'R02 Norsk bokmål', level: 'Morsmål' }, { name: 'R03 English', level: 'Fluent' }],
interests: ['R04 Friluftsliv og åpen kildekode'],
};
const markers = JSON.stringify(profile).match(/\b[SEBPR]\d{2}\b/g)!;
if (new Set(markers).size !== markers.length) throw new Error(`Duplicate fixture markers: ${sample.key}`);
return { profile, markers };
}