Files
Reactive-Resume/tooling/locales/section-titles.test.ts
T
Amruth Pillai bda01febd5 feat(schema): structured resume dates with a read-time upgrade and dual write
Dated entries and roles carry dates (start, end, present, and raw when the
text couldn't be read exactly). The parser moves to the schema package and
reports how each date was written; parseResumeData fills dates, infers the
date format from how dates were typed and rewrites the legacy period/date
text from them, so older clients and API readers keep working. API writes
sync against the stored data, so an edit to the text alone is read back
into dates.

getById and getBySlug return upgraded data, ATS date rules and sorting read
dates, JSON Resume and LinkedIn imports map their dates directly, entry
titles may be empty (drafts aren't printed), and the MCP schema resource is
generated live in place of the stale schema.json.
2026-09-28 18:20:18 +02:00

25 lines
1.2 KiB
TypeScript

import { readFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import { expect, it } from "vitest";
import { generatePresentLabels, generateSectionTitleCatalog } from "./section-titles";
it("keeps PDF headings synchronized with the source Lingui catalogs", async () => {
const catalogs = fileURLToPath(new URL("../../apps/web/locales/", import.meta.url));
const generated = await generateSectionTitleCatalog(catalogs);
const committed = JSON.parse(
await readFile(new URL("../../packages/pdf/src/section-title-catalog.json", import.meta.url), "utf8"),
);
expect(committed, "Run pnpm pdf:translations after updating translations.").toEqual(generated);
expect(generated["es-ES"]?.Experience).toBe("Experiencia");
});
it("keeps the printed 'Present' synchronized with the source Lingui catalogs", async () => {
const catalogs = fileURLToPath(new URL("../../apps/web/locales/", import.meta.url));
const generated = await generatePresentLabels(catalogs);
const committed = JSON.parse(
await readFile(new URL("../../packages/schema/src/resume/present-labels.json", import.meta.url), "utf8"),
);
expect(committed, "Run pnpm pdf:translations after updating translations.").toEqual(generated);
expect(generated["en-US"]).toBe("Present");
});