Files
Reactive-Resume/packages/pdf/src/rtl-fixture.test.ts
T
Amruth Pillai 24c882fa9f feat(pdf): roll out shared RTL layout to all templates
Introduce createRtlStyleHelpers and a single rtl flag on RenderProvider,
migrate every template page to mirrored layout styles, and rename
alignRight to alignEnd. Fix plain rich text rendering via PdfText
paragraph renderers and map legacy Times New Roman to Times-Roman.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 16:29:50 +02:00

28 lines
920 B
TypeScript

import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";
import { templateSchema } from "@reactive-resume/schema/templates";
const templatePages = templateSchema.options.map(
(template) =>
[
template,
fileURLToPath(new URL(`./templates/${template}/${capitalize(template)}Page.tsx`, import.meta.url)),
] as const,
);
function capitalize(template: string): string {
return template.charAt(0).toUpperCase() + template.slice(1);
}
describe("RTL PDF fixture", () => {
it.each(templatePages)("%s wires shared RTL helpers and alignEnd slot", (_template, pagePath) => {
const source = readFileSync(pagePath, "utf8");
expect(source).toContain("createRtlStyleHelpers");
expect(source).toContain("alignEnd");
expect(source).not.toContain("alignRight");
expect(source).not.toContain('from "@reactive-resume/utils/locale"');
});
});